video streaming simulation ns3 using onoff application

1.2k Views Asked by At

I need to simulate video streaming in ns3. I want to use onoff application. What are the values that should be used in this case (inter packet interval, data rate, packet size ....)?

1

There are 1 best solutions below

0
On

These values are entirely dependent on the type of video encoding you want to mimic the streaming behavior of and the details of the client server network. The way to go about building useful sims is to try to mimic as closely as possible a real network. I'll illustrate this with an example.

Let's have a look at simulating BBC HD over your wired network. BBC HD used the H.264 video codec with a HD datarate of between 2.5 and 12 Mbps. So, you'd want to pick a value somewhere in there. You're probably going to want to simulate CSMA (802.3) packets, where 1024B is a decent size. Your inter packet intervals may not always be the same, based on fluctuating server demands and routing concerns, so random variables are useful here.

So, assuming you can handle the server address serverAddr and packetSize, here's a snippet to get you started:

OnOffHelper onoff ("ns3::UdpSocketFactory", InetSocketAddress(serverAddr,9));
onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
onoff.SetAttribute("OffTime", StringValue("ns3::ConstantRandomVariable[Constant=0]"));
onoff.SetConstantRate(DataRate("4Mbps"), packetSize);