Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-18-2011, 06:03 AM   #1
LQ Newbie
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Explicit Control Protocol (XCP) on ns-2.34

Hi dear ns-2 users,

I use ns-2.34 and I have a simple script and I want to use the xcp on it.
My script is:
set ns [new Simulator]
set tracefile [open w]
$ns trace-all $tracefile
set namfile [open paradeigma.nam w]
$ns namtrace-all $namfile

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]

$ns duplex-link $n0 $n2 1Mb 100ms RED
$ns duplex-link $n1 $n2 5Mb 100ms RED
$ns duplex-link $n0 $n1 1Mb 100ms RED

set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp
set tcpsink [new Agent/TCPSink]
$ns attach-agent $n1 $tcpsink
$ns connect $tcp $tcpsink
set ftp [new Application/FTP]
$ftp attach-agent $tcp

set cbr2 [new Application/Traffic/CBR]
$cbr2 attach-agent $tcp

$cbr2 set packetSize_ 256
$cbr2 set interval_ 0.10

$ns at 0.1 "$ftp start"
$ns at 100.0 "$ftp stop"
$ns at 1.0 "$cbr2 start"
$ns at 99.0 "$cbr2 stop"

proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exit 0

$ns at 101.0 "finish"
$ns run
In ns-2.34 there are a script which name is xcp-tcp.tcl.
I understand this scenario but I cant modify my script to work like this.
Thanks a lot!!
Old 04-18-2011, 03:15 PM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,101

Rep: Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489Reputation: 3489
Welcome to LQ.

Your file has 40 lines, ns-2.34/tcl/ex/xcp/xcp-tcp.tcl : 400.

That's 360 lines more. 'ns xcp/xcp-tcp.tcl' : Four trace files are created,
and three times scripts for xgraph.
Also : It opens the three Xgraph scenarios ( At least one is animated.)

Why not use the 'xcp-tcp.tcl' as a template, and then make small changes,
one at a time ?

ns your-script.tcl : Creates paradeigma.nam,
Looks like a basic example, where xcp-tcp.tcl is a fairly complex one.

Last edited by knudfl; 04-19-2011 at 03:42 AM.


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
Import .img in XCP / OpenXenManager BrtG Linux - Server 0 09-10-2010 09:13 AM
LXer: BSDCan 2008: Stream Control Transmission Protocol LXer Syndicated Linux News 0 05-17-2008 08:00 PM
PPP Bridging Control Protocol (BCP) for Linux 2.4 or 2.6 cttran Linux - Networking 0 03-29-2006 06:41 PM
project on secure stream control transmission protocol(SCTP) monindra Fedora - Installation 1 05-29-2005 04:47 AM
Unsupported protocol 'Compression Control Protocol' (0x80fd) received RKris Linux - Software 0 08-21-2002 09:24 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 AM.

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