Description:

Description of Problem:
I have experienced two cases in which NS2 was unable to generate full cwnd
trace file.
First Case:
 The Variable "ifqlen" is use to assign the buffering capacity of wireless
interface. if I assign the value beyond 60, then congestion window tracing
is not fully generated.
Second Case:
 I have simulated the Wired-cum-wireless Network. the communication is in
just wired porting. in this case again the CWND tracing is not fully
generated.
NOTE: that in both above cases the simulated transport protocol is "SCTP".

How Easily Reproducible:
(e.g. every time, intermittent, once only, etc.)
Every Time

Steps to Reproduce:
(describe the minimal set of steps necessary to trigger the bug)
1. create scenario of wired-cum-wireless network and choose "SCTP" as
transport layer protocol. chose the value of "ifqlen" greater than 60.
2. choose FTP for communication, and select source and destination is in
wired portion.
3. total simulation time is 50 seconds.
4. run the tcl script.

Actual Results:
(describe what the application did after performing the above steps)
The congestion window tracing is generated about 3 seconds.


Expected Results:
(describe what the application should have done, were the bug not present)
As the simulation time was 50 seconds. So it was expected that CWND values
will be generated for 50 seconds.

Additional Information:
(the following information is helpful to debug:
 1. simulation script, detailed output files, packet trace

In following Two cases(as mentioned in problem description)the cwnd trace
file does not fully generated.
First CASE simulation script:

set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/802_11
set opt(ifq) Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(ifqlen) 200
set opt(nn) 1
set opt(adhocRouting) DSDV
set opt(cp) ""
set opt(sc) ""
set opt(x) 2000
set opt(y) 2000
#to produce random value we use seed
set opt(seed) 0.0
set opt(stop) 50.0

set opt(ftp1-start) 1.0
set opt(ftp1-stop)  49.0

set num_wired_nodes 8

#check for boundary parameters and random seed
if {$opt(x) == 0 || $opt(y) == 0 } {
   puts "No X-Y boudary values given for wireless topology\n"
}
if {$opt(seed)>0} {
   puts "Seeding Random number generator with $opt(seed)\n"
   ns-random $opt(seed)
}
#creating simulator instance
set ns [new Simulator]
$ns node-config -addressType hierarchical
AddrParams set domain_num_ 4
lappend cluster_num 6 1 1 1
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 1 1 3 1 2 1 1
AddrParams set nodes_num_ $eilastlevel

#this needs to be set for tracing sctp packets;s
Trace set show_sctphdr_ 1

set tracefd [open sctp.tr w]
$ns trace-all $tracefd
set namtrace [open sctp.nam w]
#$ns use-newtrace
$ns namtrace-all-wireless $namtrace $opt(x) $opt(y)

#create topography object
set topo [new Topography]
#define topology
$topo load_flatgrid $opt(x) $opt(y)

#create god
# 2 for HA and FA
create-god [expr $opt(nn) + 11]

#create wired nodes
set temp {0.0.0 0.1.0 0.2.0 0.3.0 0.4.0 0.4.1 0.4.2 0.5.0}
for {set i 0} {$i < $num_wired_nodes} {incr i} {
set W($i) [$ns node [lindex $temp $i]]
}
#configure for ForeignAgent and HomeAgent nodes
$ns node-config -mobileIP ON \
       -adhocRouting $opt(adhocRouting)\
       -llType $opt(ll)\
       -macType $opt(mac)\
       -ifqType $opt(ifq)\
       -ifqLen $opt(ifqlen)\
       -antType $opt(ant)\
       -propType $opt(prop)\
       -phyType $opt(netif)\
       -channelType $opt(chan)\
       -topoInstance $topo\
       -wiredRouting ON\
       -agentTrace ON\
       -routerTrace OFF\
       -macTrace OFF
#create HA and FA
set HA [$ns node 1.0.0]
set FA1 [$ns node 2.0.0]
set FA2 [$ns node 3.0.0]

#set FA2 [$ns node 3.0.0]

$HA random-motion 0
$FA1 random-motion 0
$FA2 random-motion 0

#Position (fixed) for base-station nodes (HA and FA)

$HA set X_ 100.0
$HA set Y_ 250.0
$HA set Z_ 0.0

$FA1 set X_ 600.0
$FA1 set Y_ 250.0
$FA1 set Z_ 0.0

$FA2 set X_ 1100.0
$FA2 set Y_ 250.0
$FA2 set Z_ 0.0


$ns node-config -wiredRouting OFF
set MH [$ns node 1.0.1]
set node(0) $MH
set HAaddress [AddrParams addr2id [$HA node-addr]]
[$MH set regagent_] set home_agent_ $HAaddress

#Mobile Hosts are positioned at
$MH set X_ 050.0
$MH set Y_ 250.0
$MH set Z_ 0.0


#MH starts to move towards FA2
#$ns at 10.0 "$MH setdest 1100.0 250.0 20.000"

#create links between wired and BaseStation nodes
$ns duplex-link $W(0) $W(3) 10Mb 10ms DropTail
$ns duplex-link $W(1) $W(3) 10Mb 10ms DropTail
$ns duplex-link $W(2) $W(3) 10Mb 10ms DropTail
$ns duplex-link $W(3) $W(4) 10Mb 10ms DropTail
$ns duplex-link $W(4) $W(5) 10Mb 10ms DropTail
$ns duplex-link $W(4) $W(6) 10Mb 10ms DropTail
$ns duplex-link $W(4) $W(7) 10Mb 10ms DropTail
$ns duplex-link $W(7) $HA 10Mb 10ms DropTail
$ns duplex-link $W(7) $FA1 10Mb 10ms DropTail
$ns duplex-link $W(7) $FA2 10Mb 10ms DropTail


#assigning queue limint
#$ns queue-limit $W(3) $W(4) 10

#$ns duplex-link $W(3) $FA2 5Mb 2ms DropTail
$ns duplex-link-op $W(3) $W(0) orient left-up
$ns duplex-link-op $W(3) $W(1) orient up
$ns duplex-link-op $W(3) $W(2) orient right-up
$ns duplex-link-op $W(3) $W(4) orient down
$ns duplex-link-op $W(4) $W(5) orient left-down
$ns duplex-link-op $W(4) $W(6) orient right-down
$ns duplex-link-op $W(4) $W(7) orient down
$ns duplex-link-op $W(7) $HA orient left-down
$ns duplex-link-op $W(7) $FA1 orient right-down
$ns duplex-link-op $W(7) $FA2 orient down

#creating SCTP traffic
set sctp1 [new Agent/SCTP]
$ns attach-agent $W(0) $sctp1
$sctp1 set mtu_ 1048
$sctp1 set dataChunkSize_ 1016
#$sctp1 set unordered_ 1

$sctp1 set class_ 1
$ns color 1 Blue

set trace_ch [open trace.sctp w]
$sctp1 set trace_all_ 1
$sctp1 trace cwnd_
$sctp1 trace rtt_
$sctp1 trace ssthresh_
$sctp1 attach $trace_ch

set sctp2 [new Agent/SCTP]
$ns attach-agent $MH $sctp2
$ns connect $sctp1 $sctp2

set ftp1 [new Application/FTP]
$ftp1 attach-agent $sctp1

$ns at $opt(ftp1-start) "$ftp1 start"
$ns at $opt(ftp1-stop) "$ftp1 stop"

#source connection-pattern and node-movement scripts
if { $opt(cp) == "" } {
 puts "*** NOTE: no connection pattern specified."
set opt(cp) "none"
} else {
       puts "Loading connecetion pattern..."
       source $opt(cp)
}
if { $opt(sc) == "" } {
       puts "*** NOTE: no scenario file specified."
       set opt(sc) "none"
} else {
       puts "Loading scenario file..."
       source $opt(sc)
       puts"Loading complete..."
}
#Define initial node position ends
for {set i 0} {$i < $opt(nn) } {incr i} {
#20 defines the node size in nam, must adjust it according to your
#S0cenario
#the function must be called after mobility model is defined
$ns initial_node_pos $node($i) 10
}
#Tell all nodes when the situation ends
for {set i 0} {$i < $opt(nn)} {incr i} {
 $ns at $opt(stop).0 "$node($i) reset";
}
$ns at $opt(stop).0 "$HA reset";
$ns at $opt(stop).0 "$FA1 reset";
$ns at $opt(stop).0 "$FA2 reset";

#$ns at $opt(stop).0 "$FA2 reset";
$ns at $opt(stop).0002 "puts \"NS EXITING...\"; $ns halt"
$ns at $opt(stop).0001 "stop"
proc stop {} {
       global ns tracefd namtrace
#       close $tracefd
       close $namtrace
}
#some useful headers for tracefile
puts $tracefd "M 0.0 nn $opt(nn) x $opt(x) y $opt(y) rp \
       $opt(adhocRouting)"
puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)"
puts $tracefd "M 0.0 prop $opt(prop) ant $opt(ant)"
puts "starting Simulation..."
$ns run

Second CASE simulation script:

set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/802_11
set opt(ifq) Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(ifqlen) 50
set opt(nn) 1
set opt(adhocRouting) DSDV
set opt(cp) ""
set opt(sc) ""
set opt(x) 2000
set opt(y) 2000
#to produce random value we use seed
set opt(seed) 0.0
set opt(stop) 50.0

set opt(ftp1-start) 1.0
set opt(ftp1-stop)  49.0

set num_wired_nodes 8

#check for boundary parameters and random seed
if {$opt(x) == 0 || $opt(y) == 0 } {
   puts "No X-Y boudary values given for wireless topology\n"
}
if {$opt(seed)>0} {
   puts "Seeding Random number generator with $opt(seed)\n"
   ns-random $opt(seed)
}
#creating simulator instance
set ns [new Simulator]
$ns node-config -addressType hierarchical
AddrParams set domain_num_ 4
lappend cluster_num 6 1 1 1
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 1 1 3 1 2 1 1
AddrParams set nodes_num_ $eilastlevel

#this needs to be set for tracing sctp packets;s
Trace set show_sctphdr_ 1

set tracefd [open sctp.tr w]
$ns trace-all $tracefd
set namtrace [open sctp.nam w]
#$ns use-newtrace
$ns namtrace-all-wireless $namtrace $opt(x) $opt(y)

#create topography object
set topo [new Topography]
#define topology
$topo load_flatgrid $opt(x) $opt(y)

#create god
# 2 for HA and FA
create-god [expr $opt(nn) + 11]

#create wired nodes
set temp {0.0.0 0.1.0 0.2.0 0.3.0 0.4.0 0.4.1 0.4.2 0.5.0}
for {set i 0} {$i < $num_wired_nodes} {incr i} {
set W($i) [$ns node [lindex $temp $i]]
}
#configure for ForeignAgent and HomeAgent nodes
$ns node-config -mobileIP ON \
       -adhocRouting $opt(adhocRouting)\
       -llType $opt(ll)\
       -macType $opt(mac)\
       -ifqType $opt(ifq)\
       -ifqLen $opt(ifqlen)\
       -antType $opt(ant)\
       -propType $opt(prop)\
       -phyType $opt(netif)\
       -channelType $opt(chan)\
       -topoInstance $topo\
       -wiredRouting ON\
       -agentTrace ON\
       -routerTrace OFF\
       -macTrace OFF
#create HA and FA
set HA [$ns node 1.0.0]
set FA1 [$ns node 2.0.0]
set FA2 [$ns node 3.0.0]

#set FA2 [$ns node 3.0.0]

$HA random-motion 0
$FA1 random-motion 0
$FA2 random-motion 0

#Position (fixed) for base-station nodes (HA and FA)

$HA set X_ 100.0
$HA set Y_ 250.0
$HA set Z_ 0.0

$FA1 set X_ 600.0
$FA1 set Y_ 250.0
$FA1 set Z_ 0.0

$FA2 set X_ 1100.0
$FA2 set Y_ 250.0
$FA2 set Z_ 0.0

#create a mobile node that would be moving between HA and FA.
#note address of MH indicates its in the same domain as HA.

$ns node-config -wiredRouting OFF
set MH [$ns node 1.0.1]
set node(0) $MH
set HAaddress [AddrParams addr2id [$HA node-addr]]
[$MH set regagent_] set home_agent_ $HAaddress

#Mobile Hosts are positioned at
$MH set X_ 050.0
$MH set Y_ 250.0
$MH set Z_ 0.0


#MH starts to move towards FA2
#$ns at 10.0 "$MH setdest 1100.0 250.0 20.000"

#create links between wired and BaseStation nodes
$ns duplex-link $W(0) $W(3) 10Mb 10ms DropTail
$ns duplex-link $W(1) $W(3) 10Mb 10ms DropTail
$ns duplex-link $W(2) $W(3) 10Mb 10ms DropTail
$ns duplex-link $W(3) $W(4) 10Mb 10ms DropTail
$ns duplex-link $W(4) $W(5) 10Mb 10ms DropTail
$ns duplex-link $W(4) $W(6) 10Mb 10ms DropTail
$ns duplex-link $W(4) $W(7) 10Mb 10ms DropTail
$ns duplex-link $W(7) $HA 10Mb 10ms DropTail
$ns duplex-link $W(7) $FA1 10Mb 10ms DropTail
$ns duplex-link $W(7) $FA2 10Mb 10ms DropTail


#assigning queue limint
#$ns queue-limit $W(3) $W(4) 10

#$ns duplex-link $W(3) $FA2 5Mb 2ms DropTail
$ns duplex-link-op $W(3) $W(0) orient left-up
$ns duplex-link-op $W(3) $W(1) orient up
$ns duplex-link-op $W(3) $W(2) orient right-up
$ns duplex-link-op $W(3) $W(4) orient down
$ns duplex-link-op $W(4) $W(5) orient left-down
$ns duplex-link-op $W(4) $W(6) orient right-down
$ns duplex-link-op $W(4) $W(7) orient down
$ns duplex-link-op $W(7) $HA orient left-down
$ns duplex-link-op $W(7) $FA1 orient right-down
$ns duplex-link-op $W(7) $FA2 orient down

#creating SCTP traffic
set sctp1 [new Agent/SCTP]
$ns attach-agent $W(0) $sctp1
$sctp1 set mtu_ 1032
$sctp1 set dataChunkSize_ 1000
#$sctp1 set unordered_ 1


$sctp1 set class_ 1
$ns color 1 Blue

set trace_ch [open trace.sctp w]
$sctp1 set trace_all_ 1
$sctp1 trace cwnd_
$sctp1 trace rtt_
$sctp1 trace ssthresh_
$sctp1 attach $trace_ch

set sctp2 [new Agent/SCTP]
$ns attach-agent $W(5) $sctp2
$ns connect $sctp1 $sctp2

set ftp1 [new Application/FTP]
$ftp1 attach-agent $sctp1

$ns at $opt(ftp1-start) "$ftp1 start"
$ns at $opt(ftp1-stop) "$ftp1 stop"

#source connection-pattern and node-movement scripts
if { $opt(cp) == "" } {
 puts "*** NOTE: no connection pattern specified."
set opt(cp) "none"
} else {
       puts "Loading connecetion pattern..."
       source $opt(cp)
}
if { $opt(sc) == "" } {
       puts "*** NOTE: no scenario file specified."
       set opt(sc) "none"
} else {
       puts "Loading scenario file..."
       source $opt(sc)
       puts"Loading complete..."
}
#Define initial node position ends
for {set i 0} {$i < $opt(nn) } {incr i} {
#20 defines the node size in nam, must adjust it according to your
#S0cenario
#the function must be called after mobility model is defined
$ns initial_node_pos $node($i) 10
}
#Tell all nodes when the situation ends
for {set i 0} {$i < $opt(nn)} {incr i} {
 $ns at $opt(stop).0 "$node($i) reset";
}
$ns at $opt(stop).0 "$HA reset";
$ns at $opt(stop).0 "$FA1 reset";
$ns at $opt(stop).0 "$FA2 reset";

#$ns at $opt(stop).0 "$FA2 reset";
$ns at $opt(stop).0002 "puts \"NS EXITING...\"; $ns halt"
$ns at $opt(stop).0001 "stop"
proc stop {} {
       global ns tracefd namtrace
#       close $tracefd
       close $namtrace
}
#some useful headers for tracefile
puts $tracefd "M 0.0 nn $opt(nn) x $opt(x) y $opt(y) rp \
       $opt(adhocRouting)"
puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)"
puts $tracefd "M 0.0 prop $opt(prop) ant $opt(ant)"
puts "starting Simulation..."
$ns run

NOTE: By running the above TCL SCRIPT the output files will be generated.

Reply via email to