Background
In current network communication, the application of the IP network is extended from a single data service to a real-time communication service including voice and video. With the increasing demand of applications such as IPTV and video surveillance, the change is more and more obvious. These video real-time traffic increases also put higher demands on network equipment. In video communication, VBR (variable bit rate) video is beneficial to maintain certain video quality, and it is easy to provide high-quality video to users, but when VBR is transmitted over a network, the traffic is large and bursty. The output rate of VBR traffic is a random fluctuating process, and network nodes typically allocate bandwidth according to the peak rate of VBR traffic, reserving much more bandwidth (effective bandwidth) than is actually needed for transmission to achieve the QoS (quality of service) requirements of these VBR traffic. This bandwidth allocation for VBR traffic results in a great waste of network resources, and there are still large rate fluctuations for VBR traffic, which is a major cause of network congestion. Therefore, when performing network access, traffic is usually shaped, its output characteristics are changed, the peak rate is reduced, the fluctuation of the output rate is reduced, and the utilization rate of network resources is improved.
Traffic shaping is typically used to reduce the burstiness of the output stream and smooth the output rate. Traffic shapers are typically applied at network access points of edge networks or at the next node after the generation of a source traffic. The traffic shaper may not only shape the source traffic but may also provide corresponding traffic output parameters, such as average bandwidth, maximum burst size, etc., for the admission control algorithm. In document [2] it is described how to provide and use parameters of traffic shapers for efficient admission control and traffic scheduling.
The traffic shaper includes a rate control algorithm and a data buffer. The rate control algorithm controls the output rate of the buffer, the input of which is given by the source traffic or a shaper (regulator). The document [3,4,5] proposes and discusses several rate control algorithms for traffic shaping, the most common of which is the multi-leaky bucket MLB (multi-bucket) shaping algorithm, which can be implemented both in network nodes and in end-to-end systems.
The most commonly used buffer-based deterministic traffic control algorithm is the Multiple Leaky Bucket (MLB), which uses the DLB (Dual leak buckets) model most. The flow of traffic shaping using DLB is as follows:
as shown in fig. 1, fig. 1 includes a shaper (shaper) and a shaper (shaper), where C (t) is the input rate of the source, R (t) is the output rate of the shaper, and S (t) is the rate shaper output rate. B is r And B s Token buffers for shapers and shapers, respectively, the fullness of which can be used to reflect the burstiness of the outgoing traffic, P r And P s Maximum allowed output rate, i.e. peak rate, set by shaper and shaper, respectively, the meaning of DLB means that the output rate is doubly limited by both token buffer and peak rate. B is d The maximum allowable time delay D of the shaper used for storing and forwarding data buffer and the shaper s And B d Is related to the size of the cell.
The former is used to describe and restrict the input flow only to conform to the former model (r' (t), B) r , P r ) Will be allowed to pass through it is mainly used for traffic shaping and admission control of the network. The shaper controls the communication quantity of the input flow and controls the speed of the output flow according to the set service parameters, and the main purpose is to smooth the speed of the input flow and ensure the limit conditions of no data loss, maximum introduction and the like. Both the former and shaper use the DLB model, which is distinguished by the fact that there is no data buffer in the former, and therefore the former causes loss of input data. While a time delay is introduced in the output stream due to the data buffering introduced by the shaper. The latency of a packet in a data buffer is determined by the relationship between the fullness of the data buffer and the rate of token output. The general DLB model does not take into account the fullness of the data bufferAnd the token output rate, so the introduced time delay change is large, and the maximum time delay condition is that the data buffer is full of data and the token output rate is r; d s =B d /r; The minimum delay is the case where there is no data in the data buffer and the token output rate is P s A maximum case; the time delay is 0; this delay variation is the delay jitter.
The traditional traffic shaping method mainly uses a DLB model, and the DLB model cannot meet the requirements when facing video streams with larger burstiness such as VBR. There are generally two categories: one is a deterministic algorithm applied to the premise of no data loss and given maximum time delay; another class is statistical-based non-deterministic algorithms that are delay sensitive but can tolerate little data loss. The defects are mainly shown in the following points:
(1) The traditional DLB shaping algorithm designs the size of the data buffer of the shaper and the output rate of the token according to parameters such as preset average input rate, peak rate, maximum burst degree and the like. In practical applications, the communication model parameters of the source data stream are difficult to measure accurately, and the average output rate of many source data streams is a long-term fluctuation process during transmission. For example, VBR video streams, the output rate is related to the complexity of the original video, and both the instantaneous rate and the average rate vary with the video scene. For such video streams, the conventional DLB shaping algorithm cannot adaptively adjust these parameters, and thus cannot be well adapted to the environment of the present video applications. And the JCS algorithm proposed herein can adaptively and dynamically adjust the input rate of the token.
(2) A large burstiness may be caused for data streams like VBR video. The traditional DLB algorithm adopts a method of presetting parameters such as token input rate, maximum burst degree and the like. If the burstiness of the data stream exceeds the set parameter size at a certain time, data loss will result. This can be catastrophic for some applications.
(3) In the DLB shaping algorithm, data buffering is needed to buffer the burst data so as to smooth the data stream. Thus, the delay per data packet (or per segment of a packet) in the shaping process is not equal for bursty source traffic. In general, the time delay of the larger part of the burst after shaping is larger, and the time delay of the smaller part of the burst is smaller. This introduces delay jitter into the shaping process, since the delay experienced by each packet during the shaping process is not equal. In this case, the conventional DLB shaping algorithm would be unusable for real-time applications like VBR video, which are particularly sensitive to delay jitter.
Detailed Description
The main research object of the method is specific to the VBR flow, the VBR flow has obvious burst, in the long-term process, the average rate fluctuates, the source communication traffic cannot be controlled by using a single DLB model, and the shaping algorithm of the DLB model introduces larger delay jitter; due to the sensitivity of video streams to delay jitter, the conventional DLB shaping model cannot meet the application condition of VBR video streams. Therefore, a Jitter-constrained Shaping method (JCS method (algorithm)) is proposed, which aims to study how to design a rate adjustment strategy to meet the constraint condition of delay Jitter when performing rate Shaping under limited resources, and simultaneously achieve the effect of smoothing data stream and the constraint conditions of no data loss and the like.
The main idea of the JCS method is to estimate the buffer delay of the data in the current buffer by using the relation between the fullness degree of the data buffer and the output rate of the token, then obtain the average delay of the packet after buffering by exponential weighted average, and calculate the delay jitter value of the packet according to the difference between the delay of the current packet and the average delay. And then, the token rate is adjusted according to the change of the data buffer length and the change of the jitter value, so that the time delay introduced by the packet in the data buffer is averaged as much as possible, and the jitter value is as small as possible. The adjustment direction of the token rate is generally adapted to the variation trend of the input rate, so that the delay jitter of the packet can be reduced under the condition of smoothing the VBR flow. The adjusted token input rate reflects the average rate over the time period and can be used to calculate the effective bandwidth. In order to prevent data buffer overflow and data loss, care is also taken to control the fullness of the data buffer. In this section, the theoretical basis of the JCS method is given first, and then its specific implementation is given.
For a DLB shaper, assume that the rate of incoming traffic at time t is R (t), the rate of outgoing traffic is S (t), and the token buffer length is B s The data buffer is of lengthB d The token fill rate is r (t) and the maximum output rate is P s (P s R (t)). Working side of DLB shaperThe formula is: initially, the token buffer is empty and the data buffer is empty. Tokens are then entered into the token buffer at the rate r (t), and when the token buffer is full, subsequent tokens are lost. Traffic enters a data buffer at R (t), the data buffer and the token buffer are both non-empty for packet output, each time a packet is output, a token with the same bits must be removed from the token buffer equally, and the rate of removal of data from the buffer is P s 。
The actual output rate S (t) of the DLB shaper is determined jointly by the fullness of the data buffer and the token buffer and the rate at which data is removed. When the data buffer and the token buffer are both empty, it is required that both buffers reach a packet before outputting the next packet, so S (t) is determined by the minimum value of the data input rate and the token input rate, i.e. S (t) = min { R (t), R (t) }; when both the data buffer and token buffer are non-empty, the packet output does not need to wait for the input of the buffer, S (t) is determined by the maximum rate at which packets are removed, i.e., S (t) = P s (ii) a When the data buffer is not empty and the token buffer is empty, the packet needs to wait for enough tokens to be input into the token buffer before it can be at rate P s Output according to P s The convention of > r (t) indicates that S (t) = r (t); when the token buffer is not empty and the data buffer is empty, only one packet is input, the packet can be input according to P s The rate is output, then S (t) = min { R (t), P s }. So for the DLB model with data buffers, the output rate S (t) of the rate shaper has the following formula:
S(t)=min{R(t),r(t)};L t =0,B t =0;
=min{R(t),P s };L t =0,B t >0;
=r(t);L t >0,B t =0;
=P s ;L t >0,B t >0;(5)
where L is t Indicates the length of the data buffer, B t Represents the length of the token buffer;
due to the introduction of buffering, the packets output by the DLB shaper have increased end-to-end transmission delay compared with the packets output without shaping, and the length L of the data in the buffer when the increased delay enters the buffer from the packets t And the output rate of the buffer S (t) before the packet is output. Obviously:
delay=L t /S(t);
when the data buffer is not empty, min { S (t) } = r (t) is known from formula (5), and then B is used d Is the maximum time delay D with the known length of the data buffer s =B d And/r (t). Due to the bursty nature of VBR streams, delay is introduced as well as delay jitter. The delay jitter is calculated by the difference between the current delay and the average delay, and the average delay adopts an exponential weighted average method in the JCS method:
delay_ave=delay_ave*(1-W d )+delay*W d ;
wherein W d Is an adjustable weight. The jitter value introduced by the source traffic packet during data buffer shaping can be obtained by:
jitter=delay-delay_ave;
as can be seen from equation (5), in normal operating conditions, if the data buffer is kept larger than 0 and the token buffer is full equal to 0, a stream with a constant rate r (t) can be generated, so the best operating condition for the shaper should be the case where the data buffer is not empty and the token buffer is empty. In this case, if the rate of the input stream is greater than the rate of the token output, it will cause an increase in data in the data buffer, resulting in an increase in packet delay in the buffer; conversely, if the rate of the input stream is less than the rate of the token output, a reduction in latency results. This variation in delay is the cause of jitter. This variation is an inherent property due to the burstiness of VBR streams. To control the delay jitter of the packet, the buffer length and the token output rate are controlled to match.
The structure defining the shaper is (r (t), B s ,P s ,B d ) R (t) is the rate at which tokens enter the token buffer, B s Is the maximum length of the token buffer, which specifies the maximum burst size, P, of the shaper output s Is the maximum allowed rate of the buffer output, B d Is the maximum length of the data buffer, we use (r) t ,B t ,P t ,L t ) To indicate the working state of the shaper at time t, B t Indicating the fullness of the token buffer, L t Indicating the fullness of the data buffer. r is t Representing the input rate of the token, P t Which represents the peak rate of the output stream, is typically greater than the maximum input rate. r is t The dynamic adjustment can be carried out during the working process. The specific implementation procedure of the JCS method is shown in fig. 7.
In the JCS method, the calculation is performed every other time slice Δ t. And calculating the average time delay by exponentially weighted averaging the calculated time delay each time, and then calculating the jitter of the data packet according to the difference value of the time delay and the average time delay. In the implementation process, L is adopted n To indicate the data buffer L at the nth inspection time t The state of (1); by r n To represent the input rate r of the token at the nth time of examination t (ii) a With B n To indicate the state B of token buffering at the nth time of examination t . The specific implementation process is as follows:
each time the fullness level L of the data buffer is first checked n And state B in token buffer n (ii) a If the data buffer is full L n =L n-1 (ii) a The length of the data buffer is not changed, the speed of the current flow is smooth, the time delay of the data packet in the data buffer is the same, and jitter is not generated, so that the speed of the token is not required to be adjusted; at this time, if B n > 0, the time delay is delayed by delay = L n /p s To calculate if B is n =0; the delay passes delay = L n /r n To calculate.If L is n >L n-1 (ii) a Indicating that the data buffer is more full than the last time slice. To prevent misjudgment due to short bursts, the token is buffered again n Checking if B n If not 0, it indicates that the input data in the last time period is less than r n Is the output of the average output rate, so too many packets in the data buffer are due to short-term bursts and should not be adjusted; at this time by delay = L n /p s The time delay and the average time delay are calculated. If B is n And =0, it means that the token input rate is too low, resulting in too many packets in the data buffer and an increase in delay. The delay and jitter are then calculated: delay = L n /r n (ii) a jitter = delay-delay _ ave; if the jitter meets the requirement, the adjustment is not performed for the moment; if the jitter does not meet the requirement, the time delay is over the threshold value; the rate is adjusted according to the following criteria: the jitter is made as 0 as possible, i.e. the delay remains unchanged.
To smooth the flow as quickly as possible, we here assume L n-1 /r n-1 Instead of delay _ ave, namely:
the rate Δ r that should be increased is:
if L is
n <L
n-1 (ii) a Indicating that the data buffer is less full than the last time slice, the token buffer B is checked
n If B is
n If not, the token output rate is over high, so that the packet delay in the data buffer is reduced; when the time delay = L is calculated
n /p
s (ii) a jitter = delay-delay _ ave; this time is positively adjusted: the adjusted values are:
if B is present
n =0, when calculating the delay and jitter; delay = L
n /r
n (ii) a jitter = delay-delay _ ave; if the jitter meets the requirement, the adjustment is not performed for the moment; if the jitter does not meet the requirement, the delay is over small and exceeds the threshold value; the rate is adjusted by the following values:
the following is a study of whether the JCS method maintains the loss-free property of data in the case where the jitter constraint is satisfied. When L is n >L n-1 (ii) a The fullness of the data buffer increases compared to the last time slice, B n When not 0, L is determined for a subsequent period of time based on the previous analysis n There is no increase and thus no data overflow occurs. If B is present n 0, then the token input rate is adjusted by an amount L n Is increased when L is increased n Close to B L When r is n Approximation of p s Because the instantaneous rate of data input is less than p s Therefore, the effective data length of the buffer area can not be increased any more, and the buffer area can not overflow, namely, the requirement of no data loss is met.
In order to verify the smoothing effect of the JCS method on the VBR stream and the jitter condition after shaping, 3 filters are adopted to shape the traffic of the source data stream in the experiment, and then the generated communication rate chart and the statistical information are compared, and the final smoothing effect is compared. The 3 filters were: no shaping is carried out in the 1 st type, the size of a buffer area is the maximum length of 1 packet, and data in the buffer area is output at the maximum rate of 10 Mbps; 2, based on DLB model rate shaper, using determined peak rate and token rate to control; and 3, a shaper adopting a JCS method controls the output of the buffer by adopting an online estimated peak rate and an adaptive token rate.
(1) Comparison of rate fluctuations
And (3) testing environment: the source stream is an MPEG2 VBR video stream with an average rate of about 6.7Mbps and continuous bursts up to 500Kbps, which is filtered by 3 shapers, each lasting 10 minutes, measuring the output rate once per second. The initial time starts with the reception of the 1 st packet and the initial shaper parameters define the output information originating from the encoder. Fig. 2, 3,4 are graphs of the instantaneous output rate change for each shaper in the test for 10 minutes, with time on the abscissa and basic unit: second, ordinate is output rate, basic unit: and Mbps.
Case 1 is an unshaped output stream, the rate variation is shown in fig. 2; as can be seen from fig. 2, the maximum rate of the original data stream can reach about 10M, the minimum rate is about 5M, and the rate changes faster and the rate jitter is obvious; in case 2, which is the DLB shaped output stream, the shaper parameters are (6.7 mbps,500kb, 10mbps), and the rate variation is shown in fig. 3. As can be seen from the figure, the maximum rate is around 8M and the minimum rate is close to 6M, and the shaped stream is much smoother compared to the original data stream. The 3 rd case is the output stream of the JCS method, with initial parameters of (6.7 mbps,500kb, 10mbps), and a rate variation graph as shown in fig. 4; as can be seen from fig. 4, the maximum rate is more than 7M, the minimum value is about 6M, and the rate change is more than the beginning of shaping, and after a period of time, the output stream becomes quite smooth.
Table 1: comparison of output streams under three conditions
Type (B)
|
Average rate/Mbps
|
Maximum rate
|
Minimum rate
|
Unshaped stream
|
6.584
|
10.06
|
5.0
|
DLB algorithm
|
6.81
|
7.8
|
5.85
|
JCS method
|
6.68
|
7.15
|
5.92
|
Statistics of the average rate, the maximum rate, and the minimum rate for the three cases are recorded in table 1. Comparing the traffic maps of the 3 outputs with the statistical information shows that: the average rates of the 3 output streams are basically the same, and the difference is less than 0.02%; the rate fluctuation can be measured by using the rate standard deviation and the maximum and minimum values, as shown in table 1, the rate fluctuation of the output of the original stream without shaping is maximum, the output rate fluctuation of the stream after shaping by using DLB is small, the rate fluctuation by using our method is minimum, and the output rate after shaping by using the JCS method is closest to the average rate of the source data stream.
(2) Delay jitter comparison
The average time delay, the maximum time delay, the minimum time delay and the average time delay of the DLB shaping algorithm and the JCS method are respectively recorded in the test; the statistical information is shown in table 2. The time delay variance reflects the variation fluctuation of the time delay in the whole process, namely reflects the jitter. As can be seen from the table, the average delay between the DLB algorithm and the JCS method is not very different, but the DLB shaping algorithm is 4.21ms, while the JCS method is 3.18ms. But the delay variance difference between them is very large, the delay variance of the DLB algorithm reaches 271.4, while the delay variance of the JCS method is only 3.62, which fully explains that the delay of the output stream of the JCS method is relatively constant, that is, the jitter value is small. In order to intuitively compare the delay jitter of the two methods, the jitter value change in the experimental process is given, and the jitter value is calculated by using a formula of jitter = delay-delay _ ave in the algorithm process. As can be seen from the jitter variation curve of fig. 5, the jitter variation of the DLB algorithm is large, about between-3 ms and 3ms, while the jitter value of the JCS method is about between-0.8 and 0.8.
Table 2: time delay data comparison of DLB algorithm and JCS method
Types of
|
Mean time delay/ms
|
Maximum delay/ms
|
Minimum time delay/ms
|
Variance of delay
|
DLB algorithm
|
4.21
|
7.2
|
0.85
|
271.4
|
JCS method
|
3.18
|
3.6
|
2.72
|
3.62
|
The JCS method of the present invention is mainly realized on the switching chip of the S4600 series developed by the Beacon network company and the LC-48FE hundred megaline card on the Ethernet switch, and the switching chip mainly comprises the following parts:
1) Packet Parser (Packet Parser): the main function is to parse incoming packets.
2) Packet Modifier (Packet Modifier): the method is mainly used for modifying the next hop MAC and other functions of the data packet forwarded by the L3.
3) The CPU management interface controller (CMIC: CPU Management Interface Controller): mainly responsible for the interface with CPU part; including PCI interfaces (PCI interfaces) and Management counters (Management counters).
4) Packet Filter Processor (Packet Filter Processor): the filtering function of the data packet is mainly completed.
5) Memory Management Unit (Memory Management Unit): the method is mainly responsible for cache management and flow management in the exchange chip; the method is divided into two parts, namely a Buffer Management unit (Buffer Management) and a Traffic Management unit (Traffic Management). Buffer Management unit (Buffer Management): the functions of management, access control and the like of a cache queue in a switching chip are mainly completed; traffic Management unit (Traffic Management): the JCS method is mainly used for completing functions of limiting the flow rate, shaping, managing and scheduling queues and the like.
6) Layer two forwarding logic (L2 Switching): the method mainly completes two-layer forwarding of the data packet.
7) Three-tier forwarding logic (L3 Switching): mainly completes the forwarding of three layers (IP layers) of data packets.
The software platform is an embedded operating system and a TCP/IP protocol stack on the upper layer; the embedded operating system adopts a VxWorks5.5 kernel; the protocol stack part mainly adopts a USP unified software platform developed by a beacon network company; the software development platform adopted the version of tornado2.2 for PPC. The system structure of the whole software is shown in fig. 6.
The english abbreviations referred to in fig. 6 are explained as follows:
ARP (Address Resolution Protocol): an address resolution protocol;
BGP (Border Gateway Protocol): a border network management routing protocol;
CLI (Command Line Interface): a command line;
console: a console serial port;
DCP (Distributed Communication Protocol): a distributed communication protocol;
DHCP (Dynamic Host Configuration Protocol): a dynamic host configuration protocol;
FTP (File Transmission Protocol): a file transfer protocol;
GARP (General Attribute Register Protocol): generic attribute registration protocol
GMRP (GARP Multicast Register Protocol): GARP multicast register protocol;
GVRP (GARP Vlan Register Protocol): GARP Vlan registration protocol;
HA (High Availability): high availability;
IDB (Information Database): an information database;
ICMP (Internet Control Message Protocol): an internet control message protocol;
IGMP (Internet Group Management Protocol): an internetwork group management protocol;
IP (Internet Protocol): the Internet protocol;
MSTP (Multiple spinning Tree Protocol): multiple spanning tree protocol
OSPF (Open Shortest Path First): a shortest path first protocol;
PIM/SM (Protocol Independent Multicast/Sparse Mode): a sparse mode independent multicast protocol;
RIP (Routing Information Protocol): a routing information protocol;
RSTP (Rapid Spanning Tree Protocol): a rapid spanning tree protocol;
SNMP (Simple Network Management Protocol): a simple network management protocol;
STP (spinal Tree Protocol): a spanning tree protocol;
TCP (Transmission Control Protocol): a transmission control protocol;
telnet: a remote terminal protocol;
TFTP (Trivisual File Transmission Protocol): a simple file transfer protocol;
UDP (User Datagraph Protocol): user datagram protocol.