LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2015, 10:34 PM   #1
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Rep: Reputation: Disabled
tcl script for VBR traffic


how to write tcl script for VBR traffic
 
Old 02-20-2015, 10:08 AM   #3
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Is this the correct code for generating VBR Traffic

set vbr [new Application/Traffic/VBR]
$vbr set rate_ 448Kb
$vbr set rate_dev_ 0.25
$vbr set rate_time_ 2.0
$vbr set burst_time_ 1.0
$vbr set n_o_changes_ 10
$vbr set time_dev_ 0.5
$vbr set constant_ false
$vbr set maxrate_ 648Kb
$vbr set packetSize_ 210
$vbr set maxpkts_ 268435456
I have got this code from http://ns2blogger.blogspot.in/2014/0...tation-in.html
I am using NS-2.35 Version

Last edited by Chinmayi; 02-20-2015 at 10:20 AM.
 
Old 02-20-2015, 07:23 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #3.

http://ns2blogger.blogspot.in/2014/0...tation-in.html
.. is incomplete. Seems based on
http://code.google.com/p/txsys/sourc...ate%253Dclosed
→ $ svn checkout http://txsys.googlecode.com/svn/trunk/ txsys-read-only
→ txsys-read-only/ubiquitous/ns2/src/{ .., .., vbr_traffic.cc },
txsys-read-only/ubiquitous/ns2/vbr/ \
{ cbr-sim.tcl, vbr-expo.tcl, vbr-normal.tcl, vbr.plot, vbr-uniform.tcl }.


Quote:
Is this the correct code for generating VBR Traffic
I have no idea. Is for you to try out. Then please post again if any issues.


-

Last edited by knudfl; 02-20-2015 at 07:24 PM.
 
Old 02-21-2015, 05:56 AM   #5
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Is VBR Traffic and Exponential traffic same?
what are Makefile.in & vbr_traffic.o?
Where can we get them? How to Include vbr_traffic.o in Makefile.in?

Last edited by Chinmayi; 02-21-2015 at 05:57 AM.
 
Old 02-21-2015, 06:56 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #3.
Quote:
what are Makefile.in & vbr_traffic.o ?
Makefile.in is used for generating the Makefile.
`vbr_traffic.o´ is an object file.
→ Is the compiled result from vbr_traffic.cc
→ And is linked together with ~400 other objects, into one file : ns.

Please do :
$ svn checkout http://txsys.googlecode.com/svn/trunk/ txsys-read-only
... to get ( also ) ....
txsys-read-only/ubiquitous/ns2/{ Makefile.in, src/vbr_traffic.cc }


Quote:
Is VBR Traffic and Exponential traffic same ?
Please look it up →
https://www.google.com/webhp?hl=all&...l=en&q=ns2+vbr


-
 
1 members found this post helpful.
Old 02-21-2015, 07:48 AM   #7
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
How to include vbr_traffic.cc in Makefile.in
 
Old 02-21-2015, 08:31 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #7.

» include vbr_traffic.cc in Makefile.in « : Read the link in your post #3 :
"" 1. Include vbr_traffic.o in Makefile.in "".
I.e. files.cc are not mentioned in a Makefile*. The objects to be created are.

Makefile.in is a text file. Easy to read. Or use 'grep' :
Code:
$ cd txsys-read-only/ubiquitous/ns2/
$ grep -n vbr_traffic.o Makefile.in 
179:    tools/expoo.o tools/cbr_traffic.o tools/vbr_traffic.o \
The number, '179' is the line number.
Which you can see in your Editor, when opening Makefile.in for reading.
.... So nothing to add ! vbr_traffic.o is already present.


-
 
Old 02-21-2015, 09:14 AM   #9
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
the Makefile in my NS-2.35 has a little difference in code when compared to the Makefile in http://txsys.googlecode.com/svn/trun...s2/Makefile.in. Should I repalce the original with this new one?

Last edited by Chinmayi; 02-21-2015 at 09:15 AM.
 
Old 02-21-2015, 10:17 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #9.
Quote:
Makefile.in
.
Should I repalce the original
No. Just add the object to the ns-2.35/Makefile.in :
<TAB>tools/expoo.o tools/cbr_traffic.o tools/vbr_traffic.o \
... and make sure that vbr_traffic.cc is in tools/.

And then run ./install in the top directory ns-allinone-2.35/.


-

Last edited by knudfl; 02-21-2015 at 10:19 AM.
 
Old 02-21-2015, 11:51 AM   #11
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
what is "Run make depend in ns-allinone-2.35"?How is this done?
 
Old 02-21-2015, 05:36 PM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #11.

All commands are done from the script ns-allinone-2.35/install :
That's the command $ ./install

"install" is a text file, see the ns-2.35 section, lines 531-553,
if you are using the 2011 version ns-allinone-2.35.tar.gz .
If it's the updated version, 2014 : Then the lines 578-587.
Conclusion : The way to run 'make' is $ ./install

Besides that, ./configure && make clean && make doesn't work in ns-2.35.
That was for the earlier ns2 versions.
Also : Saved some time when just running 'make'.
Old slow computer could use ~15 minutes for ./install.
Not an issue with a modern computer.


'make depend' is done automatically in the right way with ./install,
which runs 'make' in ns-2.35/.
A manual 'make depend' has never been attempted.
Somebody wrote 'make depend' many years ago.
And all the young students just repeat it in their texts.
→ → Don't believe everything you read on the Internet.


-

Last edited by knudfl; 02-21-2015 at 05:38 PM.
 
Old 02-21-2015, 09:54 PM   #13
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
My Makefile is:


#
# Copyright (c) 1991,1993 The Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the Computer Systems
# Engineering Group at Lawrence Berkeley Laboratory.
# 4. Neither the name of the University nor of the Laboratory may be used
# to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# @(#) $Header: /cvsroot/nsnam/nam-1/Makefile.in,v 1.54 2011/11/02 16:31:26 tom_henderson Exp $
#
Code:
# Top level hierarchy
prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the binary
BINDEST = @bindir@
# Pathname of directory to install the man page
MANDEST = @mandir@
# Define datarootdir as of autoconf 2.60
datarootdir = @datarootdir@

CC = @CC@
CPP = @CXX@
CCOPT = @V_CCOPT@
MKDEP = ./conf/mkdep
# Have to be the same as that defined in conf/makefile.win
TCL2C = @V_TCL2CPP@
TCLSH = @V_TCLSH@

#
# Remember to add a dependency if you add any tcl sources here.
#
LIB =  \
	@V_LIBS@ \
	@V_LIB_X11@ \
	@V_LIB@ -lm @LIBS@
INCLUDE = \
	-I. @V_INCLUDES@ \
	@V_INCLUDE_X11@ 

STATIC = @V_STATIC@
DEFINE = -DTCL_TK -DNO_VOID @V_DEFINE@ @V_DEFINES@
CFLAGS = $(CCOPT) $(DEFINE) $(INCLUDE)

INSTALL = @INSTALL@
RANLIB = @V_RANLIB@

BLANK	= # make a blank space.  DO NOT add anything to this line
AR	= ar rc $(BLANK)
LINK	= $(CPP)
LDFLAGS	=
LDOUT	= -o $(BLANK)
PERL	= perl
RM	= rm -f

# Explicitly define compilation rules since SunOS 4's make doesn't like gcc.
# Also, gcc does not remove the .o before forking 'as', which can be a
# problem if you don't own the file but can write to the directory.
.SUFFIXES: .cc $(.SUFFIXES)

.cc.o:
	rm -f $@; $(CPP) -o $@ -c $(CFLAGS) $*.cc

.c.o:
	rm -f $@; $(CC) -o $@ -c $(CFLAGS) $*.c

GEN_DIR = gen/
NAM	= nam

# WIN32: uncomment the following line to include specific make for VC++
# !include <conf/makefile.win>

OBJ_C = tkcompat.o tkUnixInit.o xwd.o

OBJ_CC = \
	netview.o netmodel.o edge.o packet.o node.o main.o \
	trace.o queue.o drop.o animation.o agent.o feature.o \
	route.o transform.o paint.o state.o monitor.o anetmodel.o \
	rng.o view.o graphview.o netgraph.o tracehook.o \
	lan.o psview.o group.o editview.o tag.o address.o animator.o \
	wnetmodel.o nam_stream.o enetmodel.o testview.o parser.o \
	trafficsource.o lossmodel.o queuehandle.o

OBJ_GEN = \
	$(GEN_DIR)version.o $(GEN_DIR)nam_tcl.o
SRC_GEN = \
	$(GEN_DIR)version.c $(GEN_DIR)nam_tcl.cc

OBJ =	$(OBJ_C) $(OBJ_CC) $(OBJ_GEN)
SRC =	$(OBJ_C:.o=.c) $(OBJ_CC:.o=.cc)

CLEANFILES = $(NAM) $(OBJ) $(SRC_GEN) core core.nam

NAM_TCL_LIB = \
	tcl/nam-lib.tcl \
	tcl/nam-default.tcl \
	tcl/balloon.tcl \
	tcl/snapshot.tcl \
	tcl/animator.tcl \
	tcl/anim-ctrl.tcl \
	tcl/netModel.tcl \
	tcl/autoNetModel.tcl \
	tcl/build-ui.tcl \
	tcl/annotation.tcl \
	tcl/node.tcl \
	tcl/monitor.tcl \
	tcl/stats.tcl \
	tcl/www.tcl \
	tcl/menu_file.tcl \
	tcl/menu_view.tcl \
  tcl/NamgraphView.tcl \
  tcl/NamgraphModel.tcl \
  tcl/TimesliderNamgraphView.tcl \
  tcl/TimesliderView.tcl \
  tcl/TimesliderModel.tcl \
  tcl/observer.tcl \
  tcl/observable.tcl \
  tcl/wirelessNetModel.tcl \
  tcl/editorNetModel.tcl \
  tcl/Editor.tcl \
  tcl/Editor-FileParser.tcl

$(NAM):	$(OBJ) $(SCRYOBJ) Makefile
	$(RM) $@
	$(LINK) $(STATIC) $(LDFLAGS) $(LDOUT)$@ \
		$(OBJ) $(SCRYOBJ) $(LIB)

Makefile: Makefile.in
	@echo "Makefile.in is newer than Makefile."
	@echo "You need to re-run configure."
	false

$(GEN_DIR)nam_tcl.cc: $(NAM_TCL_LIB)
	$(RM) $@
	$(TCLSH) bin/tcl-expand.tcl tcl/nam-lib.tcl | $(TCL2C) et_nam > $@

$(GEN_DIR)version.c: VERSION
	$(RM) $@
	$(TCLSH) bin/string2c.tcl version < VERSION > $@

install: force
	$(INSTALL) -m 755 nam $(DESTDIR)$(BINDEST)

clean:
	$(RM) $(CLEANFILES)

distclean:
	$(RM) $(CLEANFILES) Makefile config.cache config.log config.status

tar:	force
	tar=$(TAR_PREFIX)-nam-`cat VERSION`.tar.gz ; \
	rm -f $$tar ; \
	tar cfhF -  $(TAR) | gzip -c > $$tar

depend: $(SRC)
	$(MKDEP) $(CFLAGS) $(SRC)

srctar:
	@cwd=`pwd` ; dir=`basename $$cwd` ; \
	    name=nam-`cat VERSION | tr A-Z a-z` ; \
	    tar=nam-src-`cat VERSION`.tar.gz ; \
	    list="" ; \
	    for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
	    echo \
	    "(rm -f $$tar; cd .. ; ln -s $$dir $$name)" ; \
	     (rm -f $$tar; cd .. ; ln -s $$dir $$name) ; \
	    echo \
	    "(cd .. ; tar cfhz $$tar [lots of files])" ; \
	     (cd .. ; tar cfhz - $$list) > $$tar ; \
	    echo \
	    "rm ../$$name; chmod 444 $$tar" ;  \
	     rm ../$$name; chmod 444 $$tar

force:

# Create makefile.vc for Win32 development by replacing:
# "# !include ..." 	-> 	"!include ..."
makefile.vc: Makefile.in
	$(PERL) bin/gen-vcmake.pl < Makefile.in > makefile.vc
#	$(PERL) -pe 's/^# (\!include)/\!include/o' < Makefile.in > makefile.vc




Where should I include tools/vbr_traffic.o\?

Last edited by Chinmayi; 02-22-2015 at 07:51 AM.
 
Old 02-22-2015, 03:13 AM   #14
Chinmayi
LQ Newbie
 
Registered: Feb 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Ihave run the command ./install
But I am getting some error
Ihave attached the screenshot of the error
Please suggest the solution
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2015-02-22 14_30_26.png
Views:	36
Size:	249.8 KB
ID:	17634  
 
Old 02-22-2015, 04:00 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. post #13.

Not Makefile, but 204 random lines from the Makefile.in .
The valid Makefile.in, ns-2.35 has 625 lines.
* Code like post #13 must be in CODE tags.
You can see how code tags look like in post #8.
Please edit post #13 to code tags, or delete the most ..
. http://www.linuxquestions.org/questi....php?do=bbcode
. http://www.linuxquestions.org/questi...gs-4175464257/
I.e. it's the ` # ´ button in the 'Advanced Editor'.
Editing : The 'Edit' button → → "Go Advanced".
.. Or you can type [/code] at code end, and [code] at code text start.


← post #14 : You have missing "ns2 prerequisites".
Which OS are you using ? Name and version, please.

Prerequsites, Ubuntu : $ sudo apt-get install \
g++ g++-4.4 automake patch make libtool libxmu-dev xgraph

Fedora, CentOS :
# yum install gcc-c++ autoconf automake patch make libtool libXmu-devel


-
 
  


Reply

Tags
ns2, vbr



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
how to add nodes in tcl script to create topology traffic in ns2.31? lavendar89 Linux - Software 11 10-02-2014 11:10 PM
Creating VBR traffic for wireless simulation in ns2.34 Mosheca Linux - Newbie 1 02-20-2014 03:25 AM
how to simulate vbr traffic in ns2 varun1989 Linux - Software 24 06-13-2013 04:02 AM
vbr traffic model creation khan1354 Linux - Software 1 05-01-2011 05:10 AM
problem in traffic trace file genration(VBR) in ns2.34 sanviarch Linux - Networking 4 09-15-2010 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:13 AM.

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