Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
02-23-2011, 12:13 AM
|
#1
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Rep:
|
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
|
|
|
02-23-2011, 12:21 AM
|
#2
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
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.
|
|
|
02-23-2011, 04:55 PM
|
#3
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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.
|
|
|
02-23-2011, 11:42 PM
|
#4
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Original Poster
Rep:
|
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
|
|
|
02-23-2011, 11:46 PM
|
#5
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Original Poster
Rep:
|
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 !!!
|
|
|
02-24-2011, 02:57 AM
|
#6
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
*
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.
..
|
|
|
02-24-2011, 11:35 PM
|
#7
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Original Poster
Rep:
|
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
|
|
|
02-24-2011, 11:42 PM
|
#8
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Original Poster
Rep:
|
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
|
|
|
02-25-2011, 02:18 AM
|
#9
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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 ? ?
|
|
|
02-25-2011, 11:16 PM
|
#10
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Original Poster
Rep:
|
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
|
|
|
02-26-2011, 02:52 AM
|
#11
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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
|
|
|
02-26-2011, 03:32 AM
|
#12
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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".)
|
|
|
02-26-2011, 11:56 PM
|
#13
|
LQ Newbie
Registered: Oct 2010
Posts: 7
Original Poster
Rep:
|
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
|
|
|
03-24-2011, 12:55 AM
|
#14
|
LQ Newbie
Registered: Mar 2011
Location: uk
Posts: 16
Rep:
|
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.
|
|
|
03-24-2011, 01:31 AM
|
#15
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
# 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
..
|
|
|
All times are GMT -5. The time now is 12:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|