Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
|
 |
06-10-2011, 03:20 AM
|
#1
|
Member
Registered: Mar 2011
Posts: 37
Rep:
|
File Trace NS-2 and Program AWK.
This is a trace-all the files so that you can imagine my trace file format.
Code:
+ 0.1 1 0 cbr 164 ------- 1 1.0 0.0 0 0
- 0.1 1 0 cbr 164 ------- 1 1.0 0.0 0 0
r 0.111312 1 0 cbr 164 ------- 1 1.0 0.0 0 0
+ 0.111312 0 4 DTNBundle 164 ------- 1 0.0 4.0 -1 1
- 0.111312 0 4 DTNBundle 164 ------- 1 0.0 4.0 -1 1
+ 0.111312 0 1 DTNBundle 73 ------- 3 0.0 1.0 -1 2
- 0.111312 0 1 DTNBundle 73 ------- 3 0.0 1.0 -1 2
+ 0.112312 0 1 DTNBundle 81 ------- 2 0.0 1.0 -1 3
- 0.112312 0 1 DTNBundle 81 ------- 2 0.0 1.0 -1 3
+ 0.1125 1 0 cbr 164 ------- 1 1.0 0.0 0 4
- 0.1125 1 0 cbr 164 ------- 1 1.0 0.0 0 4
r 0.121896 0 1 DTNBundle 73 ------- 3 0.0 1.0 -1 2
+ 0.121896 1 0 cbr 72 ------- 4 1.0 0.0 0 5
- 0.121896 1 0 cbr 72 ------- 4 1.0 0.0 0 5
r 0.122624 0 4 DTNBundle 164 ------- 1 0.0 4.0 -1 1
+ 0.122624 4 5 DTNBundle 164 ------- 1 4.0 5.0 -1 6
- 0.122624 4 5 DTNBundle 164 ------- 1 4.0 5.0 -1 6
+ 0.122624 4 0 DTNBundle 76 ------- 3 4.0 0.0 -1 7
- 0.122624 4 0 DTNBundle 76 ------- 3 4.0 0.0 -1 7
+ 0.122624 4 8 DTNBundle 84 ------- 2 4.0 8.0 -1 8
- 0.122624 4 8 DTNBundle 84 ------- 2 4.0 8.0 -1 8
r 0.12296 0 1 DTNBundle 81 ------- 2 0.0 1.0 -1 3
This is awk filter fourth column in the file traces.
Code:
BEGIN{
i=0;
}
{
action=$1;
cl1=$2;
Cl2=$3;
cl3=$4;
cl4=$5;
if(action=="+"){
c1[i]=cl1;
c2[i]=cl2;
c3[i]=cl3;
c4[i]=cl4
i++;
}
}
END{
for(j=0;j<=i;j++){
printf("%f %x %d %s\n", c1[j], c2[j], c3[j], c4[j]);
}
}
but after running second column is have value "0"
you can edit or tell me why do I fix this.
Thank you very much.
Here is a snippet of my results.
Code:
0.122624 0 5 DTNBundle
0.122624 0 0 DTNBundle
0.123812 0 4 DTNBundle
0.123812 0 1 DTNBundle
0.125000 0 0 cbr
0.133296 0 1 DTNBundle
0.133936 0 4 DTNBundle
0.134936 0 4 DTNBundle
0.135124 0 5 DTNBundle
0.135124 0 0 DTNBundle
0.136312 0 4 DTNBundle
0.136312 0 1 DTNBundle
0.137500 0 0 cbr
0.144544 0 0 DTNBundle
0.145544 0 0 DTNBundle
0.145796 0 1 DTNBundle
0.146436 0 4 DTNBundle
0.147436 0 4 DTNBundle
0.147624 0 5 DTNBundle
0.147624 0 0 DTNBundle
0.148812 0 4 DTNBundle
0.148812 0 1 DTNBundle
Last edited by easyvn112; 06-10-2011 at 03:21 AM.
|
|
|
06-10-2011, 03:26 AM
|
#2
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
It's always 0 because you inadvertently used an uppercase C instead of lowercase:
Code:
cl1=$2;
Cl2=$3;
cl3=$4;
cl4=$5;
Change it to lower case and the result should be what you expect.
|
|
|
06-10-2011, 04:48 AM
|
#3
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,040
|
I would add that such an elaborate script is not really required:
Code:
awk '/^[+]/{printf "%f %x %d %s\n",$2,$3,$4,$5}' file
|
|
|
06-10-2011, 08:13 AM
|
#5
|
Member
Registered: Mar 2011
Posts: 37
Original Poster
Rep:
|
Quote:
Originally Posted by colucix
It's always 0 because you inadvertently used an uppercase C instead of lowercase:
Code:
cl1=$2;
Cl2=$3;
cl3=$4;
cl4=$5;
Change it to lower case and the result should be what you expect.
|
Thank you very much. All right.
|
|
|
06-10-2011, 08:30 AM
|
#6
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,040
|
Well the usual story would be, show us what you have done and where you are stuck (like your first post) and then we can help.
|
|
|
06-11-2011, 12:54 AM
|
#7
|
Member
Registered: Mar 2011
Posts: 37
Original Poster
Rep:
|
Cái này nói cũng khó, đây là file Nam ma ḿnh đang làm mô phỏng.
http://www.mediafire.com/?306toggqiap9a6q
Ḿnh đang làm mô phỏng về mạng DTN (Delay toleran networking. Ḿnh đă tính được tỉ lệ gói tin nhận và Drop. Bây giờ quan trọng ḿnh muốn lấy delay để tiến hành so sánh, với các khoảng thời gian thay đổi và thời gian truyền lại gói.
Đây là mă code TCL....
Code:
# Set variables.
set DATALOAD 8000
set MTU 1500
set PACKETSIZE 100
Agent/DTNAgent set custodian_ 1
Agent/DTNAgent set retransmit_ 0.5
# Create a simulator object
set ns [new Simulator]
# Open a trace file
set nf [open demo.nam w]
$ns namtrace-all $nf
set nk [open all.tr w]
$ns trace-all $nk
# Setup packet type colours for nam.
$ns color 1 Blue
$ns color 2 Chocolate
$ns color 3 Darkgreen
$ns color 4 Purple
# Define a 'finish' procedure
proc finish {} {
global ns nf nk
$ns flush-trace
close $nf
close $nk
exec nam demo.nam &
exit 0
}
# Create nodes
set t0n0 [$ns node]
set t0n1 [$ns node]
set t0n2 [$ns node]
set t0n3 [$ns node]
set t1n0 [$ns node]
set t1n1 [$ns node]
set t1n2 [$ns node]
set t1n3 [$ns node]
set t2n0 [$ns node]
set t2n1 [$ns node]
set t2n2 [$ns node]
set t2n3 [$ns node]
set t3n0 [$ns node]
set t3n1 [$ns node]
set t3n2 [$ns node]
set t3n3 [$ns node]
# Connect the nodes with links.
$ns duplex-link $t0n0 $t0n1 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t0n2 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t0n3 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t1n1 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t1n2 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t1n3 1Mb 10ms DropTail
$ns duplex-link $t2n0 $t2n1 1Mb 10ms DropTail
$ns duplex-link $t2n0 $t2n2 1Mb 10ms DropTail
$ns duplex-link $t2n0 $t2n3 1Mb 10ms DropTail
$ns duplex-link $t3n0 $t3n1 1Mb 10ms DropTail
$ns duplex-link $t3n0 $t3n2 1Mb 10ms DropTail
$ns duplex-link $t3n0 $t3n3 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t1n0 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t2n0 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t3n0 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t2n0 1Mb 10ms DropTail
# Create and attach agents.
set d0 [new Agent/DTNAgent]
$ns attach-agent $t0n0 $d0
set d1 [new Agent/DTNAgent]
$ns attach-agent $t0n1 $d1
set d2 [new Agent/DTNAgent]
$ns attach-agent $t0n2 $d2
set d3 [new Agent/DTNAgent]
$ns attach-agent $t0n3 $d3
set d4 [new Agent/DTNAgent]
$ns attach-agent $t1n0 $d4
set d5 [new Agent/DTNAgent]
$ns attach-agent $t1n1 $d5
set d6 [new Agent/DTNAgent]
$ns attach-agent $t1n2 $d6
set d7 [new Agent/DTNAgent]
$ns attach-agent $t1n3 $d7
set d8 [new Agent/DTNAgent]
$ns attach-agent $t2n0 $d8
set d9 [new Agent/DTNAgent]
$ns attach-agent $t2n1 $d9
set d10 [new Agent/DTNAgent]
$ns attach-agent $t2n2 $d10
set d11 [new Agent/DTNAgent]
$ns attach-agent $t2n3 $d11
set d12 [new Agent/DTNAgent]
$ns attach-agent $t3n0 $d12
set d13 [new Agent/DTNAgent]
$ns attach-agent $t3n1 $d13
set d14 [new Agent/DTNAgent]
$ns attach-agent $t3n2 $d14
set d15 [new Agent/DTNAgent]
$ns attach-agent $t3n3 $d15
# Set local Region
$d0 region "R0"
$d1 region "R0"
$d2 region "R0"
$d3 region "R0"
$d4 region "R1"
$d5 region "R1"
$d6 region "R1"
$d7 region "R1"
$d8 region "R2"
$d9 region "R2"
$d10 region "R2"
$d11 region "R2"
$d12 region "R3"
$d13 region "R3"
$d14 region "R3"
$d15 region "R3"
# Setup routing tables.
# R0
$d0 add "R1" $t1n0 1 1 $MTU
$d0 add "R1" $t2n0 1 2 $MTU
$d0 add "R2" $t2n0 1 1 $MTU
$d0 add "R2" $t1n0 1 2 $MTU
$d0 add "R3" $t3n0 1 1 $MTU
$d1 add "*" $t0n0 1 0 $MTU
$d2 add "*" $t0n0 1 0 $MTU
$d3 add "*" $t0n0 1 0 $MTU
# R1
$d4 add "R0" $t0n0 1 1 $MTU
$d4 add "R0" $t2n0 1 2 $MTU
$d4 add "R2" $t2n0 1 1 $MTU
$d4 add "R2" $t0n0 1 2 $MTU
$d4 add "R3" $t0n0 1 2 $MTU
$d4 add "R3" $t2n0 1 3 $MTU
$d5 add "*" $t1n0 1 0 $MTU
$d6 add "*" $t1n0 1 0 $MTU
$d7 add "*" $t1n0 1 0 $MTU
# R2
$d8 add "R0" $t0n0 1 1 $MTU
$d8 add "R0" $t1n0 1 2 $MTU
$d8 add "R1" $t1n0 1 1 $MTU
$d8 add "R1" $t0n0 1 2 $MTU
$d8 add "R3" $t0n0 1 2 $MTU
$d8 add "R3" $t1n0 1 3 $MTU
$d9 add "*" $t2n0 1 0 $MTU
$d10 add "*" $t2n0 1 0 $MTU
$d11 add "*" $t2n0 1 0 $MTU
# R3
$d12 add "R0" $t0n0 1 1 $MTU
$d12 add "R1" $t0n0 1 2 $MTU
$d12 add "R2" $t0n0 1 2 $MTU
$d13 add "*" $t3n0 1 0 $MTU
$d14 add "*" $t3n0 1 0 $MTU
$d15 add "*" $t3n0 1 0 $MTU
# Callback functions
Agent/DTNAgent instproc indData {sid did rid cos options lifespan adu} {
$self instvar node_
$self instvar $adu
puts "node [$node_ id] ($did) received bundle from \
$sid : '$adu'"
}
Agent/DTNAgent instproc indSendError {sid did rid cos options lifespan adu} {
$self instvar node_
puts "node [$node_ id] ($sid) got send error on bundle to \
$did : '$adu'"
}
Agent/DTNAgent instproc indSendToken {binding sendtoken} {
$self instvar node_
puts "node [$node_ id] Send binding $binding bound to token $sendtoken"
if { [string equal $binding "deleteme" ] } {
$self cancel $sendtoken
}
}
Agent/DTNAgent instproc indRegToken {binding regtoken} {
$self instvar node_
puts "node [$node_ id] Reg binding $binding bound to token $regtoken"
if { [string equal $binding "t1n3:1" ] } {
$self deregister $regtoken
}
}
# Create a CBR traffic source.
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ $PACKETSIZE
$cbr0 set rate_ [ expr 8 * $DATALOAD ]
$cbr0 attach-agent $d1
# Setup application interface.
$d1 app src R0,$t0n1:10
$d1 app dest R1,$t1n1:42
$d1 app rpt_to R0,$t0n1:11
$d1 app cos NORMAL
$d1 app options CUST,REPCUST,EERCPT,REPRCPT,REPFWD
$d1 app lifespan 300
# Register a destination action.
$d5 register SINK t1n1:42 R1,$t1n1:42
# Run the CBR for 0.5 seconds.
$ns at 0.1 "$cbr0 start"
$ns at 0.6 "$cbr0 stop"
# Cause "link failure"
for {set x 0} {$x<5} {incr x} {
$ns rtmodel-at [expr 0.05+0.20*$x] down $t0n0 $t1n0
$ns rtmodel-at [expr 0.06+0.20*$x] down $t2n0 $t1n0
$ns rtmodel-at [expr 0.07+0.20*$x] up $t0n0 $t1n0
$ns rtmodel-at [expr 0.08+0.20*$x] up $t2n0 $t1n0
}
$ns at 100.0 "finish"
#Run the simulation
$ns run
để chạy được code các bạn cần cài đặt thành công
http://www.illuvatar.nu/ns-dtn/code/
vào trong NS2...
Các bạn giúp ḿnh với nhé....
Sorry v́ tớ học kém tiếng anh.
Last edited by easyvn112; 06-11-2011 at 01:19 AM.
|
|
|
06-11-2011, 03:10 AM
|
#8
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Quote:
Originally Posted by easyvn112
Cái này nói cũng khó, đây là file Nam ma ḿnh đang làm mô phỏng.
|
Please, easyvn112 can you translate your post in English? Thanks.
|
|
|
06-12-2011, 06:48 AM
|
#9
|
Member
Registered: Mar 2011
Posts: 37
Original Poster
Rep:
|
This analysis is difficult, this is the file Nam's simulations.
http://www.mediafire.com/?306toggqiap9a6q
I'm doing on the network simulation DTN (Delay toleran networking. I've calculated the percentage of packets received and Drop. Now I want to get the delay is important to conduct a comparison with the time change and the transmission time back pack.
This is TCL code ....
Code:
# Set variables.
set DATALOAD 8000
set MTU 1500
set PACKETSIZE 100
Agent/DTNAgent set custodian_ 1
Agent/DTNAgent set retransmit_ 0.5
# Create a simulator object
set ns [new Simulator]
# Open a trace file
set nf [open demo.nam w]
$ns namtrace-all $nf
set nk [open all.tr w]
$ns trace-all $nk
# Setup packet type colours for nam.
$ns color 1 Blue
$ns color 2 Chocolate
$ns color 3 Darkgreen
$ns color 4 Purple
# Define a 'finish' procedure
proc finish {} {
global ns nf nk
$ns flush-trace
close $nf
close $nk
exec nam demo.nam &
exit 0
}
# Create nodes
set t0n0 [$ns node]
set t0n1 [$ns node]
set t0n2 [$ns node]
set t0n3 [$ns node]
set t1n0 [$ns node]
set t1n1 [$ns node]
set t1n2 [$ns node]
set t1n3 [$ns node]
set t2n0 [$ns node]
set t2n1 [$ns node]
set t2n2 [$ns node]
set t2n3 [$ns node]
set t3n0 [$ns node]
set t3n1 [$ns node]
set t3n2 [$ns node]
set t3n3 [$ns node]
# Connect the nodes with links.
$ns duplex-link $t0n0 $t0n1 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t0n2 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t0n3 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t1n1 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t1n2 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t1n3 1Mb 10ms DropTail
$ns duplex-link $t2n0 $t2n1 1Mb 10ms DropTail
$ns duplex-link $t2n0 $t2n2 1Mb 10ms DropTail
$ns duplex-link $t2n0 $t2n3 1Mb 10ms DropTail
$ns duplex-link $t3n0 $t3n1 1Mb 10ms DropTail
$ns duplex-link $t3n0 $t3n2 1Mb 10ms DropTail
$ns duplex-link $t3n0 $t3n3 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t1n0 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t2n0 1Mb 10ms DropTail
$ns duplex-link $t0n0 $t3n0 1Mb 10ms DropTail
$ns duplex-link $t1n0 $t2n0 1Mb 10ms DropTail
# Create and attach agents.
set d0 [new Agent/DTNAgent]
$ns attach-agent $t0n0 $d0
set d1 [new Agent/DTNAgent]
$ns attach-agent $t0n1 $d1
set d2 [new Agent/DTNAgent]
$ns attach-agent $t0n2 $d2
set d3 [new Agent/DTNAgent]
$ns attach-agent $t0n3 $d3
set d4 [new Agent/DTNAgent]
$ns attach-agent $t1n0 $d4
set d5 [new Agent/DTNAgent]
$ns attach-agent $t1n1 $d5
set d6 [new Agent/DTNAgent]
$ns attach-agent $t1n2 $d6
set d7 [new Agent/DTNAgent]
$ns attach-agent $t1n3 $d7
set d8 [new Agent/DTNAgent]
$ns attach-agent $t2n0 $d8
set d9 [new Agent/DTNAgent]
$ns attach-agent $t2n1 $d9
set d10 [new Agent/DTNAgent]
$ns attach-agent $t2n2 $d10
set d11 [new Agent/DTNAgent]
$ns attach-agent $t2n3 $d11
set d12 [new Agent/DTNAgent]
$ns attach-agent $t3n0 $d12
set d13 [new Agent/DTNAgent]
$ns attach-agent $t3n1 $d13
set d14 [new Agent/DTNAgent]
$ns attach-agent $t3n2 $d14
set d15 [new Agent/DTNAgent]
$ns attach-agent $t3n3 $d15
# Set local Region
$d0 region "R0"
$d1 region "R0"
$d2 region "R0"
$d3 region "R0"
$d4 region "R1"
$d5 region "R1"
$d6 region "R1"
$d7 region "R1"
$d8 region "R2"
$d9 region "R2"
$d10 region "R2"
$d11 region "R2"
$d12 region "R3"
$d13 region "R3"
$d14 region "R3"
$d15 region "R3"
# Setup routing tables.
# R0
$d0 add "R1" $t1n0 1 1 $MTU
$d0 add "R1" $t2n0 1 2 $MTU
$d0 add "R2" $t2n0 1 1 $MTU
$d0 add "R2" $t1n0 1 2 $MTU
$d0 add "R3" $t3n0 1 1 $MTU
$d1 add "*" $t0n0 1 0 $MTU
$d2 add "*" $t0n0 1 0 $MTU
$d3 add "*" $t0n0 1 0 $MTU
# R1
$d4 add "R0" $t0n0 1 1 $MTU
$d4 add "R0" $t2n0 1 2 $MTU
$d4 add "R2" $t2n0 1 1 $MTU
$d4 add "R2" $t0n0 1 2 $MTU
$d4 add "R3" $t0n0 1 2 $MTU
$d4 add "R3" $t2n0 1 3 $MTU
$d5 add "*" $t1n0 1 0 $MTU
$d6 add "*" $t1n0 1 0 $MTU
$d7 add "*" $t1n0 1 0 $MTU
# R2
$d8 add "R0" $t0n0 1 1 $MTU
$d8 add "R0" $t1n0 1 2 $MTU
$d8 add "R1" $t1n0 1 1 $MTU
$d8 add "R1" $t0n0 1 2 $MTU
$d8 add "R3" $t0n0 1 2 $MTU
$d8 add "R3" $t1n0 1 3 $MTU
$d9 add "*" $t2n0 1 0 $MTU
$d10 add "*" $t2n0 1 0 $MTU
$d11 add "*" $t2n0 1 0 $MTU
# R3
$d12 add "R0" $t0n0 1 1 $MTU
$d12 add "R1" $t0n0 1 2 $MTU
$d12 add "R2" $t0n0 1 2 $MTU
$d13 add "*" $t3n0 1 0 $MTU
$d14 add "*" $t3n0 1 0 $MTU
$d15 add "*" $t3n0 1 0 $MTU
# Callback functions
Agent/DTNAgent instproc indData {sid did rid cos options lifespan adu} {
$self instvar node_
$self instvar $adu
puts "node [$node_ id] ($did) received bundle from \
$sid : '$adu'"
}
Agent/DTNAgent instproc indSendError {sid did rid cos options lifespan adu} {
$self instvar node_
puts "node [$node_ id] ($sid) got send error on bundle to \
$did : '$adu'"
}
Agent/DTNAgent instproc indSendToken {binding sendtoken} {
$self instvar node_
puts "node [$node_ id] Send binding $binding bound to token $sendtoken"
if { [string equal $binding "deleteme" ] } {
$self cancel $sendtoken
}
}
Agent/DTNAgent instproc indRegToken {binding regtoken} {
$self instvar node_
puts "node [$node_ id] Reg binding $binding bound to token $regtoken"
if { [string equal $binding "t1n3:1" ] } {
$self deregister $regtoken
}
}
# Create a CBR traffic source.
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ $PACKETSIZE
$cbr0 set rate_ [ expr 8 * $DATALOAD ]
$cbr0 attach-agent $d1
# Setup application interface.
$d1 app src R0,$t0n1:10
$d1 app dest R1,$t1n1:42
$d1 app rpt_to R0,$t0n1:11
$d1 app cos NORMAL
$d1 app options CUST,REPCUST,EERCPT,REPRCPT,REPFWD
$d1 app lifespan 300
# Register a destination action.
$d5 register SINK t1n1:42 R1,$t1n1:42
# Run the CBR for 0.5 seconds.
$ns at 0.1 "$cbr0 start"
$ns at 0.6 "$cbr0 stop"
# Cause "link failure"
for {set x 0} {$x<5} {incr x} {
$ns rtmodel-at [expr 0.05+0.20*$x] down $t0n0 $t1n0
$ns rtmodel-at [expr 0.06+0.20*$x] down $t2n0 $t1n0
$ns rtmodel-at [expr 0.07+0.20*$x] up $t0n0 $t1n0
$ns rtmodel-at [expr 0.08+0.20*$x] up $t2n0 $t1n0
}
$ns at 100.0 "finish"
#Run the simulation
$ns run
You want to run the code you need to install successfully package DTN in the NS2.
Here is the download link and instructions to install ns2 in the DTN.
http://www.illuvatar.nu/ns-dtn/code/
Thank you very much.
|
|
|
06-12-2011, 07:36 AM
|
#10
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,040
|
So what is the issue with this code?
|
|
|
06-13-2011, 04:47 AM
|
#11
|
Member
Registered: Mar 2011
Posts: 37
Original Poster
Rep:
|
I want to calculate drop the packet and received packet latency between two consecutive nodes. So to add anything to the TCL code?
|
|
|
All times are GMT -5. The time now is 08:12 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
|
|