LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2011, 12:13 AM   #1
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Rep: Reputation: 0
Unhappy video traffic in NS2


Hi
I want to simulate video traffic in ns2.31 .I have added mpeg4_traffic patch in Contributed codes in NS2 web site .
I receive segmentation fault error ,when I debug code I got a lot of error ,I don't know what to do ?
does no one know how should transmit video in ns2 ??

i am in a dire need ,please help me
 
Old 02-23-2011, 12:21 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello and welcome to LQ!

Can you please post the actual output and errors that you are getting? The information you supply us, the better we can help.
 
Old 02-23-2011, 04:55 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

http://www.linuxquestions.org/linux/...Ask_a_Question
http://linuxsilo.net/docs/smart-questions_en.html
I.e. please specify the OS name, version, every time you ask a question.
Like Fedora 14, CentOS 5.5, Ubuntu 10.10 Maverick, etc.

A direct link to the "mpeg4_traffic patch" would be nice too.


Which command did you use to get "segmentation fault" ? ? ?

..

Last edited by knudfl; 02-23-2011 at 04:56 PM.
 
Old 02-23-2011, 11:42 PM   #4
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
NS2-2.31 on ubuntu on VMWare machine
I installed video traffic generator based on TES(Transform Expand sample) in NS2 contributed codes http://nsnam.isi.edu/nsnam/index.php/Contributed_Code
I do the patch ,and write a simple codes to use the patch

....
set source [$ns node]
set udp0 [new Agent/UDP]
$ns attach-agent $source $udp0
set vdo [new Application/Traffic/MPEG4]
$vdo set initialSeed_ 0.4
$vdo set rateFactor_ 5
$vdo attach-agent $udp0
$ns at 1.8 "$vdo start"

and named it video.tcl ,when I run this code ,I reaceived this error
then I run this command
cd ns-allinone-2.31
cd ns-2.31
cd MPEG4
gcc -c mpeg4_traffic.cc
and I received a lot of c errors ,like NS2 can't compile the file

thank for your helo
 
Old 02-23-2011, 11:46 PM   #5
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy video transmitt

Hi there again
well I want to transfer video in NS2 .after all these error I decided to encod a video file and a get a logfile.txt ,then I want to send these data from this file

does anybody have any idea !!!
 
Old 02-24-2011, 02:57 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
*
Ubuntu version : Please show the output from this command : cat /etc/issue

A direct link to the "mpeg4_traffic patch" : Please show the
download links for all the extra code, you used.

"Contributed Code" is not a direct link. It's a front page, a head line
for "1000" other pages.
..
 
Old 02-24-2011, 11:35 PM   #7
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy

ubuntu versuon is :Ubuntu 10.04 LTS \n \l
NS2-2.31

This is the link where I download the mpeg4_traffic.cc in NS2 contributed site :http://www.sce.carleton.ca/~amatrawy/mpeg4/

and I do the patches as it sayes ,in the mpeg4_traffic_README.txt file
Then I do make clean ,make without any error ,in advance I wrtite this code :

set ns [new Simulator]
$ns color 1 Blue
#open trace files
set tracefile1 [open out.tr w]
set winfile [open Winfile w]
$ns trace-all $tracefile1
set namfile [open out.nam w]
$ns namtrace-all $namfile
#define finish
proc finish {} {
global ns tracefile1 namfile
$ns flush-trace
close $tracefile1
close $namfile
exec nam out.nam &
exit 0
}
#declear nodes
set n0 [$ns node]
set n1 [$ns node]
$n0 color red
$n1 color blue
#creat links
$ns duplex-link $n0 $n1 2Mbps 10ms DropTail
$ns duplex-link-op $n0 $n1 orient right-up
$ns duplex-link-op $n0 $n1 color green
#set queue size of link
$ns queue-limit $n0 $n1 20
#creat connection
set udp [new Agent/UDP]
set null [new Agent/Null]
$ns attach-agent $n0 $udp
$ns attach-agent $n1 $null
$ns connect $udp $null
set vdo [new Application/Traffic/MPEG4]
$vdo set initialSeed_ 0.4
$vdo set rateFactor_ 5
$vdo attach-agent $udp

#ftp connection
$ns at 1.8 "$vdo start"
$ns at 50.0 "finish"
$ns run

and run :ns video.tcl (video is the name of this file)
I get segmentation fault error
 
Old 02-24-2011, 11:42 PM   #8
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy

Then I decided to find the error occurs ,and I figured out the error come from mpeg4_traffic.cc file ,so I run this command

cd /PATH where the file is /
run : gcc -c mpeg4_traffic.cc
I got errors like these :

mpeg4_traffic.cc:28:20: error: random.h: No such file or directory
mpeg4_traffic.cc:29:21: error: trafgen.h: No such file or directory
mpeg4_traffic.cc:30:20: error: ranvar.h: No such file or directory
mpeg4_traffic.cc:37: error: ISO C++ forbids declaration of ‘RNG’ with no type
 
Old 02-25-2011, 02:18 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 8. 'mpeg4_traffic_README' :
http://www.sce.carleton.ca/~amatrawy...traffic_README
QUOTE : "You need to get mpeg4_traffic.cc, put it where you have the .cc files
for ns, include it in the make file and recompile."

I.e. add mpeg4_traffic.o into the Makefile in the top directory
ns-allinone-ns-2.1b8a/ns-2.1b8a/ ( Or ns-allinone-ns-2.27/ns-2.27/.)
... And run : 'make clean && make'.
( gcc -c mpeg4_traffic.cc : Not possible.)

Again ref. the'mpeg4_traffic_README' :
"".. but some researchers told me they got it to work with ver. 2.27.""
** Which means, they probably modified something, to have it working in ns-2.27 ?
** But I can ask, where did you get the info about using ns-2.31 ? ?
 
Old 02-25-2011, 11:16 PM   #10
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I have no information about working on NS2-2.31 ,I just tried and think it will work

I passed of this work because a lot of errors ?? May I ask question ?? If I want to make a traffic from a file in NS2-2.31 ,(this file is a log of video traces include ID,TIME.LENGTH of video packet) ,should this file be in a special format ??

I want to make a traffic using [new Application\Traffic\Trace] from a file ,but I don't know how to make a correct file ??

This is my real question ,please help me make a correct traffic file
 
Old 02-26-2011, 02:52 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
See post # 9 : 'mpeg4_traffic_README'

No problem adding mpeg4_traffic.cc to ns-2.31.
Example : cd ns-allinone-2.31/ns-2.31/ && mv ns ns231 &&
cp Makefile Makefile.org && cp Makefile Makefile.org
( To save a copy of your original ns231 files.)
&& mkdir video && cp mpeg4_traffic.cc video/ && make clean

Next : Add video/mpeg4_traffic.o to Makefile.in, line 304 :
304xcp/xcpq.o xcp/xcp.o xcp/xcp-end-sys.o video/mpeg4_traffic.o \
./configure
 
Old 02-26-2011, 03:32 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Please always write code text in "code tags" here at LQ.
[/code] at code end, and [code] at code text start.
And please edit posts # 4, # 7 to use code tags.
http://www.linuxquestions.org/questions/misc.php?do=bbcode


Adding a file.cc to ns-2.31 : Post # 9, 'mpeg4_traffic_README'.

Example, ns-2.31, mpeg4_traffic.cc :
cd ns-allinone-2.31/ns-2.31/ && mv ns ns231 &&
cp Makefile Makefile.org && cp Makefile.in Makefile.in.org
( To save a copy of your original ns231 files.)
&& mkdir video && cp mpeg4_traffic.cc video/

Next : Add 'video/mpeg4_traffic.o to Makefile.in, line 304 :
Code:
	 xcp/xcpq.o xcp/xcp.o xcp/xcp-end-sys.o video/mpeg4_traffic.o \
And : make clean && ./configure && make :
Now you have compiled mpeg4_traffic.o into the new binary 'ns'.
( May be you already did get a mpeg4_traffic.o and a new 'ns' ? )

And can make a file "video.tcl", that will hopefully work.
The files you show in post #4 and #7 are not working. Can't see why, right now.

From 'mpeg4_traffic_README' :
Add this to tcl/lib/ns-default.tcl, e.g. line 491
Application/Traffic/MPEG4 set rateFactor_ 1
Application/Traffic/MPEG4 set initialSeed_ 0.5
( And please read line 461-490... : It' all about "traffic".)
 
Old 02-26-2011, 11:56 PM   #13
rahaa_15
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy

I have done everything as mentioned in moeg4_traffic_Readme ,and I do make clean ,./configure ,make
everything is successful ,I wrote this code
Code:
..
set udp [new Agent/UDP]
set null [new Agent/Null]
$ns attach-agent $n0 $udp
$ns attach-agent $n1 $null
$ns connect $udp $null
set vdo [new Application/Traffic/MPEG4]
$vdo set initialSeed_ 0.4
$vdo set rateFactor_ 5
$vdo attach-agent $udp
#video connection
$ns at 1.8 "$vdo start"
$ns at 50.0 "finish"
$ns run
but I receive
segmentation fault error
 
Old 03-24-2011, 12:55 AM   #14
khan1354
LQ Newbie
 
Registered: Mar 2011
Location: uk
Posts: 16

Rep: Reputation: 0
Post gcc-4.4.1 on ubuntu 10.10 64 bit

hello this is khan
I have gcc-4.4.5 on my ubuntu 10.10 64bit.
But I want to use gcc-4.4.1 for installation of ns-allinone-2.34.
please can you tell how can i use the this one.

It is better for me if you provide steps to me

thank you

Last edited by khan1354; 03-24-2011 at 12:57 AM.
 
Old 03-24-2011, 01:31 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 14, @khan1354 : Please do not post an off topic question.
http://www.linuxquestions.org/linux/...Ask_a_Question
Start your own thread instead.
This thread is about "Video traffic in ns-2.31" !

'gcc-4.4' works OK for me in Ubuntu 10.10 64bits. But you can also do :
1) sudo apt-get install g++-4.3
2) cd ns-allinone-2.34/ && export CC=gcc-4.3 CXX=g++-4.3 && ./install
..... which works perfectly.

More info : LQ Search → Keyword = ns-allinone

..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in traffic trace file genration(VBR) in ns2.34 sanviarch Linux - Networking 4 09-15-2010 01:16 PM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
Cannot create CBR traffic in ns2 Cataj Linux - Newbie 21 08-13-2009 12:04 AM
traffic shapping against msn/video marianop Linux - Networking 2 01-05-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration