Hi,
I’m working in the simulation of video transmissions suffering vertical
handovers and to do it I’m using NIST module and evalvid. I’m trying to
include the video transmissions (with the traces obtained thanks to
evalvid) into one of the examples of NISTt:
802_21_WIMAX-WIFI_1BS-2AP_v2.tcl, I replace the UDP-CBR traffic used in
the example with the code below (2 options) but the mobile node is only
able to receive one package as the rd trace file only has one line, the sd
trace file is perfectly generated. I would like to ask for an example of
evalvid used with a multiface node or help with my code.
Any help would be really appreciated.
Thank you in advanced.
First option:
set udp0 [new Agent/myUDP]
$udp0 set packetSize_ 1500
$udp0 set class_ 1
$udp0 set_filename path/sd_CITY
set sink0 [new Agent/myEvalvid_Sink]
$sink0 set_filename path/rd_CITY
$multiFaceNode_MN attach-agent $sink0 $80211_node
$handover_MN add-flow $sink0 $udp0 $80211_node 1 20.
$ns attach-agent $CN $udp0
Second option:
set udp0 [new Agent/myUDP]
$udp0 set packetSize_ 1500
$udp0 set class_ 1
$udp0 set_filename path/sd_CITY
set sink0 [new Agent/myEvalvid_Sink]
$sink0 set_filename path/rd_CITY
$ns attach-agent $80211_node $sink0
$ns attach-agent $CN $udp0
$ns connect $udp0 $sink0
$multiFaceNode_MN attach $sink0
$handover_MN add-flow $sink0 $udp0 $80211_node 1 20.
And later the treatment of the evalvid :
################## setting de la transmision de video ###########
set original_file_name path/st_CITY_
set trace_file_name path /video1_CITY.dat
set original_file_id [open $original_file_name r]
set trace_file_id [open $trace_file_name w]
set pre_time 0
while {[eof $original_file_id] == 0} {
gets $original_file_id current_line
scan $current_line "%d%s%d%s%s%s%d%s" no_ frametype_ length_ \ tmp1_
tmp2_ tmp3_ tmp4_ tmp5_
#scan $current_line "%d%s%d%d%f" no_ frametype_ length_ tmp1_
tmp2_
set time [expr int(($tmp2_ - $pre_time)*1000000.0)]
if { $frametype_ == "I" } {
set type_v 1
set prio_p 0
} if { $frametype_ == "P" } {
set type_v 2
set prio_p 0
} if { $frametype_ == "B" } {
set type_v 3
set prio_p 0
} if { $frametype_ == "H" } {
set type_v 1
set prio_p 0
}
set max_fragmented_size 1472 ; # payload, + 28 (cabeceras) = 1500
puts $trace_file_id "$time $length_ $type_v $prio_p
$max_fragmented_size"
set pre_time $tmp2_
}
close $original_file_id
close $trace_file_id
set trace_file [new Tracefile]
$trace_file filename $trace_file_name
##################### Rx to myTrace####################
set video1 [new Application/Traffic/myEvalvid]
$video1 attach-agent $udp0
$video1 attach-tracefile $trace_file
########################################
$ns at [expr $moveStart - 1] "$video1 start"
set end_sim_time [expr $tmp2_+ 60.0]
puts "end_sim_time: $end_sim_time"
$ns at 1010 "$sink0 closefile"
$ns at 1000 "$video1 stop"
#calculate the speed of the node
$ns at $moveStart "$80211_node setdest $X_dst $Y_dst $moveSpeed"
$ns at $moveStart "$80216_node setdest $X_dst $Y_dst $moveSpeed"
$ns at 1000 "finish"
puts "Running simulation for $opt(nbMN) mobile nodes..."
$ns run