Skip to content

Simulation of Realistic Video Traffic under ns-2 using Video Trace files

Introduction

In this mini project, a video streaming traffic model will be simulated under ns2 for simulating realistic video. The model will be tested with “Video Trace Files” which are encoded dummy video sequences available for such kind of video related researches. The proposed idea is to be validated through simulation using ns-2.

The Video Trace file format used for Streaming Simulation

A previous work provided a publicly available library of frame size traces of long MPEG- 4 and H.263 encoded videos in the QCIF format resulting in low bandwidth video streams. These traces can be used for the simulation of 3G networks. Some future communication systems, such as the WLAN systems, offer high data rates and therefore high quality video can be transmitted over such higher speed networks. Because the preencoded video sequences are encoded by different users they differ in the video settings in terms of codec, quality, format, and length. The advantage of user diversity for encoding is that it reflects very well the traffic situation in upcoming WLANs. Thus, the new traces are very suitable for the network performance evaluation of future WLANs.

The following lines shows the format of the video trace file proposed to be used in this project. (3 Second Video)

#Time[ms] Frametype Length[byte]
#______________________________________________
 0 I 687
 80 P 380
 160 PB 1987
 560 PB 5113
 1000 P 38
 1040 P 1148
 1280 PB 1767
 1440 PB 1734
 1760 PB 1937
 1920 PB 1889
 2240 PB 1833
 2320 PB 1795
 2720 PB 2243
 2800 P 627
 2880 P 828
 3000 P 625

Important Sections of the Tcl Script Written for this Simulation

Parameters of the Simulation

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

Configure and Create Nodes

$ns node-config -adhocRouting $val(rp) \
 -llType $val(ll) \
 -macType $val(mac) \
 -ifqType $val(ifq) \
 -ifqLen $val(ifqlen) \
 -antType $val(ant) \
 -propType $val(prop) \
 -phyType $val(netif) \
 #-channelType $val(chan) \
 -topoInstance $topo \
 -agentTrace ON \
 -routerTrace ON \
 -macTrace ON \
 -movementTrace OFF \
 -channel $chan_1 \
 -channel $chan_2

#$ns node-config -adhocRouting $val(adhocRouting)
for {set i 0} {$i < 6} {incr i} {
set node($i) [$ns node]
$ns initial_node_pos $node($i) 30
$node($i) random-motion 1
set tx [$rng integer 800]
set ty [$rng integer 800]
$node($i) set X_ $tx
$node($i) set Y_ $ty
$node($i) set Z_ 0.0
set tx [$rng integer 800]
set ty [$rng integer 800]
$ns at 0.0 "$node($i) setdest $tx $ty 20.0"
set tx [$rng integer 800]
set ty [$rng integer 800]
$ns at 10.0 "$node($i) setdest $tx $ty 20.0"
set tx [$rng integer 800]
set ty [$rng integer 800]
$ns at 20.0 "$node($i) setdest $tx $ty 20.0"
set tx [$rng integer 800]
set ty [$rng integer 800]
$ns at 30.0 "$node($i) setdest $tx $ty 20.0"
set tx [$rng integer 800]
set ty [$rng integer 800]
$ns at 40.0 "$node($i) setdest $tx $ty 20.0"
set tx [$rng integer 800]
set ty [$rng integer 800]
$ns at 50.0 "$node($i) setdest $tx $ty 20.0"
}

 

$node(0) set X_ 100.00
$node(0) set Y_ 250.00
$node(0) set Z_ 0.0
$node(0) color "blue"
$ns initial_node_pos $node(0) 30.000000
$ns at 0.0 "$node(0) label Video-Server"
$ns at 0.0 "$node(0) color #6185cf3c0000"

#set node(1) [$ns node]
$node(1) set X_ 100.00
$node(1) set Y_ 750.00
$node(1) set Z_ 0.0
$node(1) color "blue"
$ns initial_node_pos $node(1) 30.000000


#set node(2) [$ns node]
$node(2) set X_ 200.00
$node(2) set Y_ 400.00
$node(2) set Z_ 0.0
$node(2) color "black"
$ns initial_node_pos $node(2) 30.000000


#set node(3) [$ns node]
$node(3) set X_ 250.00
$node(3) set Y_ 600.00
$node(3) set Z_ 0.0
$node(3) color "black"
$ns initial_node_pos $node(3) 30.000000

#set node(4) [$ns node]
$node(4) set X_ 450.00
$node(4) set Y_ 600.00
$node(4) set Z_ 0.0
$node(4) color "black"
$ns initial_node_pos $node(4) 30.000000

#set node(5) [$ns node]
$node(5) set X_ 650.00
$node(5) set Y_ 650.00
$node(5) set Z_ 0.0
$node(5) color "black"
$ns initial_node_pos $node(5) 30.000000
$ns at 0.0 "$node(5) label Video-Client"
$ns at 0.0 "$node(5) color red"

 

 

Generate the Video Traffic From Realistic Video Trace File

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

Setting Up the Flows

# CONFIGURE AND SET UP A FLOW

set udp [new Agent/UDP]
$ns attach-agent $node(0) $udp

set sink [new Agent/LossMonitor]
$ns attach-agent $node(5) $sink

$ns connect $udp $sink

# read the video trace file:

set trace_file [new Tracefile]
$trace_file filename $trace_file_name

set video [new Application/Traffic/Trace]
$video set class_ 3
$video attach-agent $udp
$video attach-tracefile $trace_file

The 6 Node Scenario with Video Server and Client

Results with DSR Routing

Size of packets transmitted over time at the server end

 

The throughput measured at Client.

 

The packet loss rate

Results with AODV Routing

Size of packets transmitted over time at the server end

 

The throughput measured at Client.

 

The packet loss rate

Conclusion

A Tcl script based video streaming support for ns2 was successfully simulated and tested in ns2. For that a standard traffic agent (Traffic/Trace) was used in a different manner to support video trace traffic. The experiments were repeated with DSR, AODV protocols available in ns2 Since the video trace generation will not consume so much traffic, the video streaming simulation produced results similar that of a CBR traffic and it was observed that the packet loss during the video streaming simulation is same as in the case of CBR. AODV produced good results and there was no packet loss during most of the trials. But while using DSR, packet loss was observed during the initial stages of communication. We have tested the video traffic trace with only one transmitter and one receiver.

 

WhatsApp Discuss Through WhatsApp