Modelling of H.264 MPEG2 TS Traffic Source

This paper deals with IPTV traffic source modelling. Traffic sources are used for simulation, emulation and real network testing. This model is made as a derivation of known recorded traffic sources that are analysed and statistically processed. As the results show the proposed model causes in comparison to the known traffic source very similar network traffic parameters when used in a simulated network.


Introduction
The aim of this work is to define a precise VBR (Variable Bit Rate) HD (High Definition) H.264 MPEG2 TS (Moving Pictures Experts Group Transport Stream) IPTV (Internet Protocol Television) traffic generator that can be used as a replacement to real traffic sources.Generators are often used for network stress testing, by network delivered QoS testing [1] or as a help for prediction of QoS parameters like one-way delay, packet losses and jitter [2].
Traffic generators have some major advantages over real traffic in creating network load.The load can be created with a small amount of effort, no content streaming rights are needed, and preparing a large test with hundreds of streams can be performed in several seconds instead of hours.More information about IPTV networks and signal delivery can be seen in [3].
Our proposed model uses the following packetization stack: MPEG2 TS streamed over RTP (Real-time Transport Protocol), UDP (Used Datagram Protocol), IPv4 (Internet Protocol version 4), and Ethernet (Ethernet II or 802.3an), [4].This stack is often used for several reasons.MPEG2 TS is used as a container format for streaming multiplexed video, audio and data.
TS has several control mechanisms that are used for stream monitoring at end stations.RTP [5] ensures a better QoS supervision and quality management in IP network.The Ethernet II or 802.3ab are considered because these types of Ethernet technologies were used in our measurements.Measurements were made at the Ethernet layer, so L2 (layer 2 of the Reference Model Open System Interconnection) headers and minimal Ethernet frame sizes are also considered.
The rest of this paper is organized as follows.The second chapter describes the current state of art, IPTV stream analysis and evaluations of measurements.The third chapter is devoted to the model of the IPTV generator.The fourth and last chapter is the conclusion.

State of Art
IPTV packet generation can be a quite complex problematic.IPTV traffic itself is a time-variant self-similar process.These traffic properties can be partially described by several modeling approaches.Some of these IPTV traffic models are working only at the packet level.In [6] an analytical two level Markovian model is described.These types of generators are often not compute intensive but their can lack of accuracy.
Another approach is in the levelization of the process of IPTV packets generation.This means, that generation does not occur only at the packet level but also higher levels of creating MPEG video are involved.We created a four level traffic model were the MPEG GoP (Group of Pictures) length and structure, I (Intracoded), B (Bi-directional) and P (Predicted) frame sizes and MPEG2 TS packetization are taken into account.
Also other mathematical approaches like semi-Markovian [7], wavelets [8] or multifractal analyses [9] are applicable.These models are often aiming at a special field in the overall process of generators.

IPTV Stream Parameters and Measurements
IPTV streams can be distinguished by a number of parameters such as: • VBR or CBR (Constant Bit Rate), • GoP length, • static or variable GoP structure, • MPEG profile (e.g.Baseline, Main), • number of streams carried within a multiplex, • packetization.
Our compressed video stream uses a common frame rate of 25 frames/s with 188 bytes long MPEG2 TS Media Frames.7 Media Frames are encapsulated into RTP/UDP/IP/Ethernet packets.Only 7 frames are encapsulated because of Ethernet data field length limitation.

Measurements
We want to thank to Slovak Telekom Inc. which provided to us IPTV traffic records.Without these records our research could not be successful.We made measurements on this real IPTV traffic with variable and fixed GoP structures.The first measurement is packet based where times between generation of packets and packet lengths were observed.The next measurement is aimed to the H.264 video structure where GoP lengths and frame sizes are inspected.From these two investigations we are able to create IPTV statistics.
For packet based measurements we used the well known Wireshark program that can also run on Ubuntu Linux.We modified the settings of Wireshark so it is able to display the interarrival time with a nanosecond time resolution.This nanosecond resolution is not the same as the precision of measurement.Because normal non real time operating systems are not very usable for time sensitive signal processing or measurements, measured results are affected by a variable operating system load dependent error.Also when a real-time kernel would be used the error wouldn't be much smaller because of minimal guaranteed system response time which is commonly bigger than 20 ms.But this error can be reduced because the processed signal is a MPEG2 TS with constant interarrival time of packets between two consecutive PCR (Program Clock Reference) transmissions.

1) IPTV Packets Interarrival Times
Figure 1 shows the measured interarrival time of IPTV packets with time errors.These errors can be effectively filtered with a 1 dimensional median filter which can be used multiple times in tandem (Fig. 2).Times T1 and T2 equals.The picture shows them as two nonequal intervals but the X axes displays the packet number and the Y axes shows the interarrival time.When interarrival times are smaller, more packets have to be sent out because the 100 ms PCR interval can't be broken.On the other hand with a higher interarrival time fewer packets need to be transmitted.Therefore it cannot be said that the best fitted distribution function is one of the mentioned above.We have also made excessive measurements to evaluate an overall PDF for a mean IPTV HD stream which is made from 20 IPTV HD streams.We choose as the best fitting PDF the Burr distribution function.The best fitting PDF depends on the content and video coding.
Therefore another IPTV provider can use other video coding settings.The results would vary but the selected Burr distribution function can lead to similar behavior when IPTV services provider's streams uses VBR and GoP structure that matches to the proposed model.Figure 4 shows the distribution of GoP structures in the used movies.In most cases it uses the GoP of 30 frames.Smaller GoPs are results of scene cuts in video content.The average length of GoP structure is 26,238 frames.This variable cannot be described by a known discrete PDF.Therefore we model this PDF manually and automatically.Figure 5 displays the PDF of I frame sizes.This distribution can be precisely approximated by the Burr PDF.Also B and P frames can be approximated by this PDF.The Burr CDF (Cumulative Distribution Function) is defined in Eq. ( 1), where α and k are con- tinuous shape parameters and β is a continuous scale parameter: PDF of I, B and P frame sizes are approximated with Burr PDF with the following parameters:

H.264 HD Generator
This section describes the generator design and results.
The results are compared to real IPTV H.264 HD traffic.

Generator Design
The generator defines four levels of creating content.At the first the generator defines the GoP lengths.This can be considered as the fourth level.The lengths are then replaced by a defined static GoP structure of the H.264. Main profile which is the third level.These frames are after the creation of GoP structure replaced by frame sizes in bytes which is the second level.The first level is the packetization of generated frames into RTP, UDP, IP and Ethernet frames.The packetization process takes the MPEG2 TS PCR into account.
Manually generated GoP lengths are using an uniform random number generator in R ∈ 0, 1 which drives an ON/OFF model.A generated real number is used as an input to the ON/OFF model.For example if the generated value is equal to 0,24015 and defined ranges for the twenty first state of the ON/OFF model are between 0,240125 and 0,24025 the generated GoP length equals to 21.
The automated generation of GoP lengths is defined by the measured GoP PDF.The generator code uses a uniform random numbers generator in R ∈ 0, 1 which uses the recorded discrete GoP PDF value.The output value is used for searching the recorded GoP PDF in reverse to discover the best position of the current bar of the discrete GoP PDF.After this search a GoP length output value is generated.
The generated number of the manual or automated generators is replaced by a defined GoP structure of I, B and P frames.This structure is defined as static, so it does not change during generation of IPTV packets.We used the I B B B P B B B P . . .structure.Every generated stream begins with I frames.When generating more streams in parallel they will generate at the beginning of this tests a high amount of data because of this fact.Therefore stream generation should be used.
Frame sizes are generated using the Burr CDF.The inverse function of the Burr CDF formula Eq. ( 1) is showed in Eq. ( 2) which is used as a generating function for I, B and P frame sizes in bytes.The CDF (x) argument is replaced by a uniform random number generator in R ∈ 0, 1 .The generated GoP structure is then replaced by frame sizes in bytes.These sizes take also the MPEG2 TS overhead into account.We also define minimum and maximum frame sizes in bytes for generated frames: I 782, 750000 , B 188, 115000 and P 188, 252000 and the occurrence of B and P frames that could be bigger than I frames to 0,5 %: Packets are generated from the sequence of frame sizes that consist of payload and a MPEG2 header.These data have to be split into 188 bytes long chunks.Seven of these chunks are then encapsulated into packets with the 12 B RTP, 8 B UDP, 20 B IP and 38 B Ethernet overhead (Ethernet overhead includes Inter Frame Gap, Preamble, Destination Address, Source Address, Type field and Forward Error Correction).Because PCR is sent every 100 ms the interarrival time of IPTV packets have to be constant in this time.When the frame rate of an IPTV stream is 25 frames per second the 100 ms time interval equals to 2,5 frames.So the number of generated packets is a function of the number of bytes that have to be sent out and the 100 ms time interval.Then the number of packets is converted to the time between generation of packets in this manner: (100/number of packets) in milliseconds.The packet size (Ethernet frame size) of 1 394 bytes remain always the same.
The comparison of measured and generated IPTV HD streams is discussed in several ways.Figure 6 shows the comparison of CDFs of measured and generated times between generations of packets.The solid line shows the CDF of measured IPTV traffic as a func-tion of itself.The dashed line shows the CDF of generated IPTV traffic as a function of the CDF of measured traffic.As can be seen from these results the slope of lines is approximately the same and the maximal absolute difference between them is 0,1. Figure 7 and Fig. 8 show Lag-plots of measured and generated interarrival times of IPTV packets.The generated traffic is more concentrated around the base line as the generated traffic.This is the result of a non perfect median filtering of measured times.These times vary a bit around the mean value within a PCR interval.On the other side the generated traffic remains a constant time between generation of IPTV packets within a PCR interval.For the purpose of testing the model we used an in MatLab developed network simulator with QoS (Quality of Service) mechanisms applied.The testing scenario uses IPTV streams multiplexed to 366 Mb•s −1 using a FIFO switch at Head End.These streams are then transported to a switch where VoIP and Data traffic classes are merged.This switch uses the WRR (Weighted Round-Robin) method for preferring VoIP and IPTV classes.Every test uses the same VoIP and   Data classes' sequences with different IPTV records (generated and measured).Figure 9 shows the RFC 3550 packet delay variation PDF of generated and real traffic measured between the input of the first switch in the simulated network and the output of the last switch in network.The correlation coefficient of these two curves equals to 0,99987.Also one way delay has equivalent properties with a correlation coefficient of 0,99987 (Fig. 10).In the test scenarios no IPTV packets were lost so the lost rate is not discussed.In tests where the IPTV traffic suffers transfer losses in simulation network these losses are about the same.

Conclusion
In this paper we propose a four-level HD H.264 VBR IPTV stream generator.Real world video streams are analyzed and results are used for the model definition.
Realized simulations and measurements have shown that the generator is precise and can be used in simulations and in real word testing.

Fig. 2 :
Fig. 2: Filtration of IPTV packets interarrival time using a 1D median filter.Red line -original measured interarrival time, blue line -filtered curve.

Figure 3
Figure 3 shows the PDF (Probability Distribution Function) of measured interarrival time of a chosen IPTV HD stream.As the figure shows the PDF can be approximated by the Inverse Gaussian PDF.Other measurements fit better to other distribution functions e.g.Johnson SB, Log-Logistic, Gamma, Burr or Lognormal.The best fitted distribution function depends on many factors when creating an IPTV stream.Therefore it cannot be said that the best fitted distribution function is one of the mentioned above.We have also made excessive measurements to evaluate an overall PDF for a mean IPTV HD stream which is made from 20 IPTV HD streams.We choose as the best fitting PDF the Burr distribution function.The best fitting PDF depends on the content and video coding.

Fig. 3 :
Fig. 3: PDF of packets interarrival time of a one chosen IPTV HD stream.Red curve shows an approximation by the Inverse Gaussian distribution.

Fig. 6 :
Fig. 6: Comparison of Cumulative Distribution Functions where: solid line shows the CDF of measured IPTV HD stream and the dashed line shows the CDF of generated IPTV HD stream.

Fig. 7 :
Fig. 7: Lag plot of interarrival times of chosen measured IPTV HD traffic stream with applied median filter.

Fig. 8 :
Fig. 8: Lag plot of times between generation of IPTV HD traffic packets.

Fig. 10 :
Fig. 10: One-way delay PDF of generated (red) and real (blue)IPTV traffic that occurred in the test network.