ERROR MODELS SIMULATIONS IN TRANSMISSION CHANNELS USING NETWORK SIMULATOR ENVIRONMENT

This paper discusses transmission channels evaluation, error models and their subsequent simulations for the transmission of video content. To create a network topology and error channel models, NS-2 environment is used. In this paper, we simulated two basic error channel models, namely Gilbert-Elliot and Binary Symmetric channel model. Network traffic in topology is created by NT-MyEvalvid2 toolkit, which also serves to evaluate the data transferred and their subsequent visualization. In paper, we compare the measure of packet loss when using these error models with different input parameters and their impact on the quality of video transmission parameter evaluated by PSNR.


INTRODUCTION
NS-2 is an open-source event-driven simulator designed specifically for research in computer communication networks.Since its inception in 1989, NS2 has continuously gained tremendous interest from industry, academia, and government.Having been under constant investigation and enhancement for years, NS-2 now contains modules for numerous network components such as routing, transport layer protocol, application, etc.To investigate network performance, researchers can simply use an easy-to-use scripting language to configure a network, and observe results generated by NS-2.Undoubtedly, NS-2 has become the most widely used open source network simulator, and one of the most widely used network simulators [6].
Generally, network simulators facilitate the study of network architectures such as IP QoS implementations.NS-2 is one of them.It is widely used for IP network studies.One of the areas that can be enhanced in NS-2 are the postprocessing capabilities [15].Network simulation scripts in NS-2 are used to create the network scenarios and upon the completion of the simulation, trace files that capture events occurring in the network are produced, as is shown in Fig. 1.The trace files would capture information that could be used in performance study, e.g. the amount of packets transferred from source to destination, the delay in packets, packet loss etc.However, the trace file is just a block of ASCII data in a file and quite cumbersome to access using some form of post-processing technique [16].

SOFTWARE ARCHITECTURE
NS-2 is an object oriented simulator written in C++ that uses OTcl (an object oriented version of Tcl) as the command and configuration interface.Thus, the entire software hierarchy is written in C++, with OTcl used as a front end.C++ code serves as a backbone for the whole simulation process.NS-2 use two languages because simulator has two different kinds of things it needs to do.On the one hand, detailed simulations of protocols require a systems programming language which can efficiently manipulate bytes, packet headers, and implement algorithms that run over large data sets [14].For these tasks, runtime speed is important and turn-around time (run simulation, find bug, fix bug, recompile, re-run) is less important.On the other hand, a large part of network research involves slightly varying parameters or configurations, or quickly exploring a number of scenarios.In these cases, iteration time (change the model and re-run) is more important.Since configuration runs once (at the beginning of the simulation), runtime of this part of the task is less important [2].One drawback of combining two languages is that debugging becomes more complicated than with one language alone [10].
NS-2 gluess C++ and OTcl together by providing support for split objects, that are objects that appear in both languages.When the user creates a new simulator object through the interpreter, the object is first instantiated in the interpreted hierarchy (OTcl).Then a corresponding object in the compiled hierarchy (C++) is created.Attributes of these objects can be bound together.When one is changed, the other is automatically updated.Likewise, compiled methods can be called from OTcl and vice versa [10].
The basic simulator objects that NS-2 includes are Nodes, Links, Agents and Applications.Nodes and Links define the network topology.Agents represent endpoints where network-layer packets are constructed or consumed and are commonly used to implement protocols at various levels.Applications are sources that send and receive data.The objects are connected to each other in a layered fashion as shows Fig. 2 [10].

Node
Node Node Agent Application Link Link Fig. 2 The basic NS-2 objects and their interconnections When a agent is attached to a node, it is given a unique address consisting of the node id and a port number within that node.Each node can have multiple agents attached to it.Multiplexing/demultiplexing between those are handled automatically within the Node object.Before the simulation starts, agents must be connected to each other in pairs [12].This will not trigger a protocol level connection.It will only set the source and destination address of the packets to match the two endpoints.This is similar to the connection used in UDP.
There are two major types of agents in NS-2: oneway and two-way agents.The one-way agent consists of one sender and one corresponding receiver.Data can only be sent in one direction and often connection establishment/teardown is not performed.A one-way agent simulates the basic protocol behavior, in most cases how data is transferred, without the added complexity of a full protocol implementation [13].The result is a simple implementation with reduced development time.If the service of the one-way agent is not enough for the simulation scenario, two-way agent can be used instead.The two-way agent is both a sender and receiver, supports bi-directional data transfers, and could be very well a real-world counterpart.Currently, NS-2 offers support for various versions of TCP and for TRFC [10].

PACKET LOSS MODELING
Communication channel can be classified into two categories: memoryless channels and channels with memory [8].Space or satellite channels are a few examples of memoryless channels.On these channels, a received signal at a given time interval depends only on the transmitted signal in that time interval, but not on previous signal transmissions.As a result, errors appear randomly on memoryless channels, and therefore these channels are often referred as random-error channels.Many real communication channels, however, have memory.Errors on these channels tend to occur in clusters or bursts [4].This bursty behaviour is common in mobile communication channels, telephone channels, and magnetic or optical recording systems.In simulation section, we focused on two simple channel models, the binary symmetric channel (BSC) model representing a memoryless channel, and the Gilbert-Elliott channel model representing a channel with memory.
In order to evaluate quality of transmission, lets have random variable X.If packet is not lost, then X = 0, otherwise X = k for k lost packets.After that, we can build loss model with infinite number of states (m is infinite value see Fig. 3).Such model gives us opportunity to model packet loss probabilities in dependence on burst lengths (several consecutively lost packets).For each additional lost packet, which adds to the length of a loss burst, a state transition takes place.If packet is correctly received, then the state returns to X = 0 [17].State probability for system k > 0 with is P(X ≥ k).For finite number of received packets a, state probabilities of the system with k > 0 can be approximated with cumulative loss rate [17].
Cumulative loss rate for k = 0, thus for no loss case, can be computed using the following equation: where o k (o n ) is occurrence of loss with length k(n).

Loss model with limited number of states
In order to model packet losses during video or audio transmissions, it is sufficient to use models with limited number of states due to strict requirements, which have to be fulfilled, i.e. it is useless to transmit multimedia through a network with long consecutive packet losses.
Three the most commonly used models with limited number of states are: the k-th order Markov chain model, the 2-state Markov chain model and the Bernoulli loss model.

K − th order Markov chain model
K − th order Markov chain model has similar performance measures as model with infinite number of states, however state probability for finite state m is added and also probability for transition from m to m is added.Thus for cumulative loss holds the following term [17] For burst loss k = m holds: and for conditional loss k = m holds: where: d -number of dropped packets: K-th order Markov chain model is also known as Extended Gilbert model [5].

Gilbert model
Packet loss measurements on the Internet have shown that the probability of loss episodes of length k decreases approximately geometrically with increase of k [9].Thus it is possible to use simpler packet loss model, e.g.Gilbert model.
Special case of k − th order Markov chain model is Gilbert model with , see Fig.In this model, 0 represents state with no packet loss and on the other hand 1 represents the state of packet being lost.
The matrix for transition probabilities and for state probabilities can be expressed in form: For unconditional probability P(X = 1) holds the following equation: If previous packet is lost, then for conditional probability of having loss holds: Gilbert model memorizes only the previous state, thus the probability, that the next packet will be lost is dependent only on the previous state.
Transition probabilities p 01 and p 10 can be expressed with the following equations: The probability of having a lost episode with length k [9] p k = (a − p 10 ) k−1 p 10 (12)

Bernoulli model
The simplest way, how to model packet losses, is using Bernoulli model.In this model, the probability, that the packet is lost or correctly received is independent on all other values.
Bernoulli model can be characterized by a single parameter r, which describes the probability of packet being lost [12].
where: n i -number of times, when packet loss has occurred, n -total number of packets.

The binary symmetric channel model
The binary symmetric channel model (BSC) is a simple model for discrete memoryless channels (DMC).A discrete memoryless channel of M-ary inputs and Q-ary outputs is defined by the transition probabilities P( j/i) ,where 0 ≤ i ≤ (M1) a 0 ≤ j ≤ (Q1).
In the BSC model, M = 2 and Q = 2.The model is completely defined by a channel error rate or crossover probability ε as shown in Fig. 5 [8].
Fig. 5 The binary symmetric channel model

PERFORMANCE PARAMETER
The performance parameters that can be obtained through the NS2 trace analyzer are as follows, which are the main parameters of interest for IP QoS [16]: Throughput is the rate at which a network sends or receives data.It is a good channel capacity of network connections and rated in terms bits per second (bit/s).
where P a -received packets, P f -amount of forwarded packets over certain time interval.

Packet loss
Packet loss is where network traffic fails to reach its destination in a timely manner.Most commonly packets get dropped before the destination can be reached.
where P s -amount of sent packets, P a -amount of received packets.

Jitter
Jitter is a fluctuation of end-to-end delay from one packet to the next packet of connection flow.
where D i+1 -delay of i th + 1 packet, D i -delay of i th packet.

End to end delay
End-to-end delay refers to the time taken for a packet to be transmitted across a network from source to destination.
where T d -packet receive time at the destination, T spacket send time at source node.

EVALVID -VIDEO QUALITY EVALUATION TOOL-SET
EvalVid is a framework and tool-set for evaluation of the quality of video transmitted over a real or simulated communication network.It is targeted for researchers who want to evaluate their network designs or setups in terms of user perceived video quality [7].
Besides measuring QoS parameters of the underlying network, like loss rates, delays, and jitter, standard video quality metrics like PSNR and SSIM and a subjective video quality evaluation metric of the received video are provided.Currently, H.264 MPEG-4 and H.263 are supported.AAC support is also included, though the perceptual quality evaluation has to be done by external tools implementing dedicated metrics like PESQ or PEAQ [7].

MyEvalvid-NT
A novel realistic simulation tool-set known as MyEvalvid-NT for evaluating video delivery over simulated networks was created.This tool-set integrates Evalvid and NS2 [3].The tool-set can adopt traffic trace file from the output of encoding raw YUV video or from Internet traffic traces.

System characteristics
Fig. 6 shows the system architecture of MyEvalvid-NT [3].In this framework, we can use two different input sources: 1, publicly available traffic trace [11] and 2, the trace from encoding raw YUV video.Fig. 6 shows the QoS assessment framework for video traffic enabled by the new tool-set that combines EvalVid and NS2.As shown in Fig. 6, three connecting interfaces, namely MyTraffic-Trace2, MyUDP, and MyEvalvid Sink2, are implemented in NS2 environment [3].
These three interfaces are described as follows: MyTrafficTrace2: It is employed to extract the frame type and the frame size of the video trace file.Then it fragments the video frames into smaller segments and sends these segments to the lower UDP layer at the appropriate time according to the user settings specified in the simulation script-file.
MyUDP: Essentially, MyUDP is an extension of the UDP agent in NS2.This new agent allows users to specify the output file name of the sender trace file and it records the timestamp of each transmitted packet, the packet id, and the packet payload size.
MyEvalvid Sink2: is the receiving agent for the fragmented video frame packets sent by MyUDP.When receiving a video packet, this agent also records the timestamp, packet ID, and payload size of each received packet in the user specified file [3].Fig. 6 The system architecture of MyEvalvid-NT

SIMULATIONS
In General, PSNR is the metric used to measure the perceived quality at the end user.However, PSNR takes a long time to compare each pixel in the original frame and distorted frame to get PSNR value.Alternatively we can use decodable frame rate (Q) [3] to measure video quality at the receiver, which takes less time compared to PSNR.Therefore, in this paper, we use decodable frame rate as one of our main video evaluation metric.Through simulations, we also reveal that decodable frame rate can evaluate the perceived quality well by an end user.

Used topology
The simulation topology used in this paper is shown in Fig. 7.The video server transmits video streams over the Internet and wireless links to the video receiver.The maximum transmission packet size is 1024 bytes.The link between the wireless access point and the video receiver is IEEE 802.1 lb 11Mbps.For simplicity, we assume that the link between the video server and the wireless access point has a 10Mbps bandwidth and 10 ms latency [3].
In this simulation, we make three assumptions as follows: 1.No packet loss occurs in the wired segment of the video delivered path.
2. One packet loss will result in frame undecodable

Simulation results
The several simulations were done due to evaluation of used scenario.The results were processed using graphs and tables.In each simulation, the same values (10 Mb/s) of bit rate and maximal delay (10 ms) were used.

Simulation results using BSC multicast channel model
The first simulated model was BSC channel model in multicast wireless network [1].In order to portray the graphs clearly, we simulated three different values of error rate: 1%, 10% and 50%.As is shown in Fig. 8, the first two values of error rate achieved approximately the same PSNR values.In some cases only, they were different due to more dynamic moments in video sequence.At the highest value of error rate (50%), the PSNR value was less than 20 dB.
On the basis of further simulations, we compared the values Q and PSNR, that are listed in Table .1.As is possible to see, the lower value of Q, the lower PSNR value and the lower quality of received video sequence.In case of Q = 92,83%, the PSNR value was equal to 32.7 dB, whereas in case of Q = 7.88%, the PSNR value was equal to 12.3 dB.Using video sequences obtained in simulations, we observed the losses and errors of each video sequences in yuvviewer tool.We compared them with original ones.Fig. 9 and Fig. 10 show an example of that case.We compared the frame no.278 of used original video sequence (see Fig. 9 right) with damaged video (see Fig. 9 left) at 0.1 error rate.

Simulation results using BSC unicast channel model
The second simulated model was BSC channel model in unicast wireless network [1].Again, in order to portray the graphs clearly, we simulated three different values of error rate.Since there was no difference in results between error rate values from 1% to 20%, we portrayed the graph for three values different from those in previous channel model, namely 1%, 30% and 80%.As is shown in Fig. 11, first two values of error rate achieved approximately the same PSNR values.They were different only in some cases during more dynamic moments in video sequence.At the highest value of error rate (80%), the PSNR value was less than 20 dB, only from frame no.120 to frame no.160, PSNR exceeded 20 dB value.
Again, we compared the values of Q and PSNR, that are present in Table .2.As we already know, the lower value of Q, the lower PSNR value and the lower quality of received video In case of Q = 95,69%, the PSNR value was equal to 32.49 dB, what we consider to be a quite good video quality.Fig. 12 shows dependence of mentioned Q and error rate values using BSC unicast wireless channel model.The last simulated model was BSC channel model in unicast wireless network [1].We simulated three different values of error rate: 1%, 10% and 50%, as it was in first simulated channel model As is shown in Fig. 13, the first two values of error rate achieved approximately the same PSNR values.They were different only in some cases during more dynamic moments in video sequence.At the highest value of error rate (50%), the PSNR value was less than 20 dB, only from frame no.120 to frame no.160, PSNR exceeded 25 dB value.As shows Table 3, Q and values are changing regularly, but at the level of error rate 30%, both values changed markedly, what we consider to be a worse video quality.Fig. 14 shows relation between Q and error rate values using Gilbert-Eliott multicast channel model.

CONCLUSIONS
In our paper, we focused on testing of new simulation tool-set MyEvalvid-NT, that connects Evalvid and NS-2 simulators.The benefit of such simulations is the possibility to test a real behaviour of wireless or others networks and various variants offered by this tool-set.We simulated two channel models, namely Binary Symmetric and Gilbert-Eliott models, in order to evaluate their characteristics, in both unicast and multicast transmission cases.From the simulation results, we learn that the video quality of the lower packet error rate is superior to the higher packet error rate and corresponds to the results of decodable frame rate (Q).In addition, because PSNR is a well-known performance metric of evaluating video delivery quality, we also revealed that the Q metric reflects the behavior of PSNR well [3].Therefore, we can evaluate the video delivered quality more quickly through the tool-set when we verify designs in multimedia communication.
In brief, the used scenario would be a good choice for researchers who want to verify their designs in multimedia communication, such as network protocols or QoS control schemes.

Fig. 9 Fig. 10
Fig. 9 Frame no.278 of the chosen original and damaged video sequence

Fig. 11
Fig. 11 PSNR values for BSC unicast channel model

Fig. 12
Fig. 12 The packet error rate in % and Q values comparison for BSC unicast channel model

Fig. 14
Fig. 14 The packet error rate in % and Q values comparison for Gilbert-Eliott multicast channel model

Table 1
PSNR and Q values for BSC multicast channel model

Table 2
PSNR and Q values for BSC unicast channel model

Table 3
PSNR and Q values for Gilbert-Eliott multicast channel model